最近更新时间:2024-09-10 16:07:38
该接口适用于用户创建容器集群。
POST
参数 | 类型 | 是否必选 | 描述 |
---|---|---|---|
ClusterName | String | 是 | 集群名称 |
ClusterDesc | String | 否 | 集群描述 |
ClusterManageMode | String | 否 | master管理形态 |
VpcId | String | 是 | 集群所在的vpcid |
PodCidr | String | 是 | 集群pod的网段,如:10.0.0.0/16 |
ServiceCidr | String | 是 | 集群Service的网段,如:10.1.0.0/16 |
MaxPodPerNode | Integer | 否 | 每个节点上运行的pod数量上限 |
NetworkType | String | 是 | 集群的网络模型 |
K8sVersion | String | 是 | 容器服务支持的k8s的集群版本号 |
ReserveSubnetId | String | 是 | 集群所在vpc终端子网id |
ManagedClusterMultiMaster.N | Array of ManagedClusterMultiMaster | 否 | 当集群类型为托管集群时生效,为托管集群控制面进行子网和安全组配置,支持配置多个 |
MasterEtcdSeparate | Boolean | 否 | 该字段仅针对于独立部署集群生效,托管集群不生效。集群Master和Etcd组件部署方式,有效值: |
PublicApiServer | String | 否 | 是否将apiserver暴露到公网。若不需要暴露,则不填写此选项;若选择暴露,则会创建公网SLB和EIP用于开启集群的Api Server公网访问。需要用户传递弹性EIP创建透传参数,json化字符串格,详见创建弹性IP。 |
InstanceForNode.N | Array of InstanceForNode | 否 | 新建节点创建集群,定义节点角色和配置,支持云服务器机和专属云服务器。 |
ExistedInstanceForEpc.N | Array of ExistedInstanceForEpc | 否 | 使用已有的云物理机创建集群,定义节点角色和配置 |
EncryptionProviderKey | String | 否 | 指定KMS密钥ID,使用该密钥对数据盘进行加密 |
参数 | 类型 | 描述 |
---|---|---|
RequestId | String | 请求id |
ClusterId | String | 集群id |
http://kce.api.ksyun.com/?Action=CreateCluster&Version=2020-12-31
&ClusterName=openapi开机集群
&ClusterDesc=This is a test cluster
&ClusterManageMode=DedicatedCluster
&VpcId=31e21dca-c92e-4b06-a8ce-xxxxx
&PodCidr=10.66.0.0/16
&ServiceCidr=10.254.0.0/16
&NetworkType=Flannel
&K8sVersion=v1.12.3
&ReserveSubnetId=372bdbac-ea1d-4f99-9c30-xxxxxxx
&PublicApiServer={"LineId":"xxxxxxx","BandWidth":"5","ChargeType":"PostPaidByDay"}
&InstanceForNode.1.NodeRole=Master_Etcd
&InstanceForNode.1.NodeConfig.1.Para={"MaxCount":3,"MinCount":3,"ImageId":"5bbc21d6-c48c-4c8a-b057-fcbb164bcbf7","SubnetId":"7e23b980-11c2-4bb0-9388-xxxxxxx","InstancePassword":"xxxxxxx","SecurityGroupId":"d46c7672-7ca9-4f51-bbd9-0e28ccdf3fac","ChargeType":"Daily","SystemDisk.DiskType":"SSD3.0","SystemDisk.DiskSize":30,"DataDisk.1.Type":"SSD3.0","DataDisk.1.Size":50,"InstanceType":"N2.4B","PurchaseTime":0,"InstanceName":"master","InstanceNameSuffix":1,"DataDisk.1.DeleteWithInstance":"true"}
&InstanceForNode.1.NodeConfig.1.AdvancedSetting.DockerPath=/data1/docker
&InstanceForNode.1.NodeConfig.1.AdvancedSetting.Label.1.Key=createdby
&InstanceForNode.1.NodeConfig.1.AdvancedSetting.Label.1.Value=user
&InstanceForNode.1.NodeConfig.1.AdvancedSetting.DataDisk.FileSystem=ext3
&InstanceForNode.1.NodeConfig.1.AdvancedSetting.DataDisk.MountTarget=/data1
&InstanceForNode.2.NodeRole=Worker
&InstanceForNode.2.NodeConfig.1.Para={"MaxCount":1,"MinCount":1,"ImageId":"5bbc21d6-c48c-4c8a-b057-fcbb164bcbf7","SubnetId":"7e23b980-11c2-4bb0-9388-xxxxxxx","InstancePassword":"Root123123","SecurityGroupId":"d46c7672-7ca9-4f51-bbd9-0e28ccdf3fac","ChargeType":"Daily","SystemDisk.DiskType":"SSD3.0","SystemDisk.DiskSize":30,"DataDisk.1.Type":"SSD3.0","DataDisk.1.Size":50,"InstanceType":"N2.4B","PurchaseTime":0,"InstanceName":"worker","InstanceNameSuffix":1,"DataDisk.1.DeleteWithInstance":"true"}
&InstanceForNode.2.NodeConfig.1.AdvancedSetting.DockerPath=/data1/docker
&InstanceForNode.2.NodeConfig.1.AdvancedSetting.Label.1.Key=createby
&InstanceForNode.2.NodeConfig.1.AdvancedSetting.Label.1.Value=user
&InstanceForNode.2.NodeConfig.1.AdvancedSetting.DataDisk.FileSystem=ext4
&InstanceForNode.2.NodeConfig.1.AdvancedSetting.DataDisk.MountTarget=/data1
{
"RequestId": "c9afa2b9-be8a-49d4-bebf-xxxxxxx"
"ClusterId": "b12d7079-1e59-4626-90eb-xxxxxxx"
}
支持使用已有的云物理主机创建容器集群。
http://kce.api.ksyun.com/?Action=CreateCluster&Version=2020-12-31
&MaxPodPerNode=256
&ClusterManageMode=DedicatedCluster
&VpcId=31e21dca-c92e-4b06-a8ce-xxxxxx
&PodCidr=10.78.0.0/16
&ServiceCidr=10.254.0.0/16
&NetworkType=Flannel
&K8sVersion=v1.15.5
&ReserveSubnetId=372bdbac-ea1d-4f99-9c30-xxxxxx
&ClusterName=test-cluster
&ClusterDesc=测试
&ExistedInstanceForEpc.1.NodeRole=Master_Etcd
&ExistedInstanceForEpc.1.EpcConfig.1.Para:{"InstanceId":"082ecbfc-b84e-49a1-a3b9-xxxxxx"}
&ExistedInstanceForEpc.1.EpcConfig.1.AdvancedSetting.DockerPath=/data1/data/docker
&ExistedInstanceForEpc.1.EpcConfig.1.AdvancedSetting.Label.1.Key=createby
&ExistedInstanceForEpc.1.EpcConfig.1.AdvancedSetting.Label.1.Value=user
&ExistedInstanceForEpc.1.EpcConfig.2.Para={"InstanceId":"1016c2ef-9a34-42a5-a2c4-xxxxxx"}
&ExistedInstanceForEpc.1.EpcConfig.2.AdvancedSetting.DockerPath=/data1/data/docker
&ExistedInstanceForEpc.1.EpcConfig.2.AdvancedSetting.Label.1.Key=createby
&ExistedInstanceForEpc.1.EpcConfig.2.AdvancedSetting.Label.1.Value=user
&ExistedInstanceForEpc.1.EpcConfig.3.Para={"InstanceId":"824cc7ad-bbb7-4dd3-9ccd-xxxxxx"}
&ExistedInstanceForEpc.1.EpcConfig.3.AdvancedSetting.DockerPath=/data1/data/docker
&ExistedInstanceForEpc.2.NodeRole=Worker
&ExistedInstanceForEpc.2.EpcConfig.1.Para={"InstanceId":"f8574c10-620d-4264-8b2b-xxxxxx"}
&ExistedInstanceForEpc.2.EpcConfig.1.AdvancedSetting.DockerPath=/data1/data/docker
&ExistedInstanceForEpc.2.EpcConfig.1.AdvancedSetting.UserScript=dG91Y2ggL3Jvb3QvMTExMQo=
&ExistedInstanceForEpc.2.EpcConfig.1.AdvancedSetting.Schedulable=false
{
"RequestId": "c79283f6-49c5-4c18-ba74-xxxxxx",
"ClusterId": "be502bb4-49e2-4572-ba63-xxxxxx"
}
纯净模式