全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

移入裸金属服务器到集群

接口说明

该接口用于添加已有EPC实例到k8s集群中

请求参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数
参数名称
类型
必填
描述
Action String
公共参数,本接口取值:AddClusterEpcInstances。
Version String
公共参数,本接口取值:2019-08-06。
ClusterId String

集群id

InstanceId.N String

移入集群的裸金属服务器实例id,即HostId

注:参数InstanceId.N和EpcPara.N必须填写一个,不能同时填写,也不能同时为空

EpcPara.N String

裸金属服务器产品重新安装操作系统的透传参数,json化字符串格式,详见重装租赁裸金属服务器

示例值:{"HostId":"2ba57721-d15a-4174-b0b5-00468a76af42","ImageId":"5fb883d8-78ba-4ab6-a116-06be20403f3b","KeyId":"991e1884-3980-4db8-9cdf-098f8c236bb0","Password":"Root123456"}
AdvancedSetting Object

节点高级设置

ContainerRuntime String

容器运行时,根据集群版本和需求选择
Kubernetes版本<1.24时,有效值:

  • docker
  • containerd

Kubernetes版本≥1.24时,有效值:

  • contained
    默认值:docker
ContainerPath String

容器的存储路径,不填写的话默认为/data/container

UserScript String

base64 编码的用户脚本, 此脚本会在 节点上k8s 组件运行后执行, 需要用户保证脚本的可重入及重试逻辑,脚本和生成的日志的文件可在录/usr/local/ksyun/kce/userscript路径查看

PreUserScript String

base64 编码的用户脚本, 此脚本会在节点上 k8s 组件运行前执行, 需要用户保证脚本的可重入及重试逻辑,脚本和生成的日志的文件可在录/usr/local/ksyun/kce/pre_userscript路径查看

Schedulable Boolean

节点加入集群后是否可以正常调度,默认值:true

Label.N Object

节点加入集群时预置的标签

Key String

标签键,校验规则:不超过63个字符,只能包含字母、数字及分隔符("-"、"_"、"."、"/"),且必须以字母、数字开头和结尾

Value String

标签值,校验规则:不超过63个字符,只能包含字母、数字及分隔符("-"、"_"、"."),且必须以字母、数字开头和结尾

ExtraArg Object

自定义节点上k8s组件的参数

Kubelet.N Object

用户自定义kubelet的参数

CustomArg String

用户自定义kubelet的参数,格式k1=v1,如: --feature-gates=EphemeralContainers=true

ContainerLogMaxSize Int

自定义容器日志采集文件大小,超出此大小日志将滚动写入下一文件,默认值为100m

ContainerLogMaxFiles Int

自定义容器日志采集文件最大数量,默认值为10个

Taints.N Object

节点加入集群时预置污点,匹配污点容忍进行调度

Key String

污点名称,校验规则:不超过253个字符,只能包含字母、数字及分隔符("-"、"_"、"."、"/"),且必须以字母、数字开头和结尾

Value String

污点值,校验规则:不超过63个字符,只能包含字母、数字及分隔符("-"、"_"、"."、"/"),且必须以字母、数字开头和结尾

Effect String

污点效果,有效值为NoSchedule、PreferNoSchedule、NoExecute

返回参数

参数名称
类型
描述
RequestId String

请求id

示例值:25953a30-3807-4b55-b872-813a4d37b950
InstanceSet Object[]
Return Boolean

执行结果

示例值:true
InstanceId String

裸金属服务器实例id

示例值:9c362d96-ad25-491d-8f7d-xxxxxxx

请求示例

curl -X GET|POST
'http://kce.api.ksyun.com/?Action=AddClusterEpcInstances&Version=2019-08-06'
-H 'authorization: xxx, SignedHeaders=content-type;host;x-amz-date, Signature=xxx'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'host: kce.api.ksyun.com'
-H 'x-amz-date: 20170720T022802Z'
-d 'ClusterId=xxx&InstanceId.N=xxx&EpcPara.N=xxx&AdvancedSetting.ContainerRuntime=xxx&AdvancedSetting.ContainerPath=xxx&AdvancedSetting.UserScript=xxx&AdvancedSetting.PreUserScript=xxx&AdvancedSetting.Schedulable=xxx&AdvancedSetting.Label.N.Key=xxx&AdvancedSetting.Label.N.Value=xxx&AdvancedSetting.ExtraArg.Kubelet.N.CustomArg=xxx&AdvancedSetting.ContainerLogMaxSize=xxx&AdvancedSetting.ContainerLogMaxFiles=xxx&AdvancedSetting.Taints.N.Key=xxx&AdvancedSetting.Taints.N.Value=xxx&AdvancedSetting.Taints.N.Effect=xxx'

返回示例

JSON格式

{
"RequestId":"25953a30-3807-4b55-b872-813a4d37b950",
"InstanceSet":[
{
"Return":true,
"InstanceId":"9c362d96-ad25-491d-8f7d-xxxxxxx"
}
]
}

错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码

错误码
错误信息
Http状态码
描述
ClusterIdRequiredClusterId is required400集群ID必须填写
ClusterIdInvalidClusterId must match `^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$`400集群ID必须满足 `^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$`
ParamInvalidInstanceId and EpcPara can't be empty at the same time400InstanceId与EpcPara不能同时为空
InstanceIdSizeExceedthe number of InstanceId can't exceed 50400实例ID数量不能超过50
InstanceIdInvalidInstanceId contains repeat value400InstanceId不能包含重复值
EpcParaSizeExceedthe number of EpcPara can't exceed 50400EpcPara数量不能超过50
EpcParaInvalidEpcPara is invalid, it must be json string400EpcPara参数必须是正确的json字符串
UserScriptLengthExceedthe length of UserScript can't exceed 16*1024400用户脚本长度不能超过16*1024个字符
PreUserScriptLengthExceedthe length of PreUserScript can't exceed 16*1024400用户前置脚本字符长度不能超过16*1024
ContainerRuntimeInvaliddocker is unsupported when k8s version > 1.24400集群版本大于1.24时不支持docker运行时
FileSystemInvalidFileSystem is invalid400文件系统无效,仅支持ext3、ext4、xfs
LabelKeyInvalidlabel key must match (^[a-z0-9A-Z]([-_./a-zA-Z0-9]){0,61}[a-z0-9A-Z]$)|(^[a-zA-Z0-9]$)400标签key格式必须满足 (^[a-z0-9A-Z]([-_./a-zA-Z0-9]){0,61}[a-z0-9A-Z]$)|(^[a-zA-Z0-9]$)
LabelValueInvalidlabel value must match(^[a-z0-9A-Z]([-_.a-zA-Z0-9]){0,61}[a-z0-9A-Z]$)|([a-zA-Z0-9])?400标签值格式必须满足 (^[a-z0-9A-Z]([-_.a-zA-Z0-9]){0,61}[a-z0-9A-Z]$)|([a-zA-Z0-9])?
TaintInvalidtaint key must match ((^[A-Za-z0-9]([-_./A-Za-z0-9]){0,251}[A-Za-z0-9]$)|^[A-Za-z0-9]$)400污点key格式必须满足 ((^[A-Za-z0-9]([-_./A-Za-z0-9]){0,251}[A-Za-z0-9]$)|^[A-Za-z0-9]$)
ClusterNodeExceedProductLimitcluster node num has exceed product limit400集群节点数量超过了售卖套餐最高上限
ClusterNotFoundcluster xx is not found400集群不存在
GetClusterErrorfailed to get cluster400获取集群信息失败
HostNameInvalidthe hostname xx of epc xx is invalid400EPC实例hostname无效,无法注册为k8s节点名称
ParseEpcParaErrorEpcPara is invalid400解析EpcPara发生错误
ContainerAgentValueInvalidContainerAgent value must be 'supported'400重装EPC时容器Agent必须支持
ReinstallEpcFailedepc xx reinstall failed400epc重装失败
纯净模式常规模式

纯净模式

点击可全屏预览文档内容