最近更新时间:2024-09-10 16:07:39
该接口适用于用户创建容器集群。
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 |
MasterEtcdSeparate | Boolean | 否 | 该字段仅针对于独立部署集群生效,托管集群不生效。集群Master和Etcd组件部署方式,有效值: |
ManagedClusterMaster | 否 | 当集群类型为托管集群时生效,为托管集群控制面进行子网和安全组配置 | |
InstanceSet.N | Array of InstanceSet | 否 | 新建虚拟机节点创建集群,定义节点角色和配置,支持普通云主机和专属云主机。 |
ExistedInstanceEpcSet.N | Array of ExistedInstanceEpcSet | 否 | 使用已有的云物理机创建集群,定义节点角色和配置。 |
PublicApiServer | String | 否 | 是否将apiserver暴露到公网。若不需要暴露,则不填写此选项;若选择暴露,则会创建公网SLB和EIP用于开启集群的Api Server公网访问。需要用户传递弹性EIP创建透传参数,json化字符串格,详见创建弹性IP。 |
参数 | 类型 | 描述 |
---|---|---|
RequestId | String | 请求id |
ClusterId | String | 集群id |
http://kce.api.ksyun.com/?Action=CreateCluster&Version=2019-08-06
&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"}
&InstanceSet.0.NodeRole=Master_Etcd
&InstanceSet.0.NodePara.0={"MaxCount":3,"MinCount":3,"ImageId":"5bbc21d6-c48c-4c8a-b057-fcbb164bcbf7","SubnetId":"7e23b980-11c2-4bb0-9388-xxxxxxxx","InstancePassword":"Root23123","SecurityGroupId":"d46c7672-7ca9-4f51-bbd9-xxxxxxxx","DataDiskGb":50,"ChargeType":"Daily","InstanceType":"I3.4B","PurchaseTime":0,"InstanceName":"openapi-master","InstanceNameSuffix":1}
&InstanceSet.1.NodeRole=Worker
&InstanceSet.1.NodePara.0={"MaxCount":3,"MinCount":3,"ImageId":"5bbc21d6-c48c-4c8a-b057-fcbb164bcbf7","SubnetId":"7e23b980-11c2-4bb0-9388-xxxxxxxx","InstancePassword":"Root23123","SecurityGroupId":"d46c7672-7ca9-4f51-bbd9-xxxxxxxx","DataDiskGb":50,"ChargeType":"Daily","InstanceType":"I3.4B","PurchaseTime":0,"InstanceName":"openapi-worker","InstanceNameSuffix":1}
{
"RequestId": "c9afa2b9-be8a-49d4-bebf-dd87851456db"
"ClusterId": "b12d7079-1e59-4626-90eb-xxxxxxx"
}
支持使用专属云服务器创建容器集群。
http://kce.api.ksyun.com/?Action=CreateCluster&Version=2019-08-06
&ClusterManageMode=DedicatedCluster
&VpcId=31e21dca-c92e-4b06-a8ce-xxxxxx
&PodCidr=10.67.0.0/16
&ServiceCidr=10.254.0.0/16
&NetworkType=Flannel
&K8sVersion=v1.12.3
&ReserveSubnetId=372bdbac-ea1d-4f99-9c30-xxxxxx
&InstanceSet.0.NodeRole=Master_Etcd
&InstanceSet.0.NodePara.0={"DedicatedHostId":"33b44f3e-a037-423e-a850-xxxxxx","InstanceConfigure.VCPU":4,"InstanceConfigure.MemoryGb":8,"MaxCount":3,"MinCount":3,"ImageId":"5bbc21d6-c48c-4c8a-b057-fcbb164bcbf7","SubnetId":"f2ac1919-0e34-4812-8290-xxxxxx","InstancePassword":"Root23123","SecurityGroupId":"d46c7672-7ca9-4f51-bbd9-xxxxxx","DataDiskGb":50,"ChargeType":"Daily","PurchaseTime":0,"InstanceName":"k8s-kdc-master","InstanceNameSuffix":1,"InstanceType":"DVM1.NONE"}
&InstanceSet.1.NodeRole=Worker
&InstanceSet.1.NodePara.0={"DedicatedHostId":"33b44f3e-a037-423e-a850-xxxxxx","InstanceConfigure.VCPU":4,"InstanceConfigure.MemoryGb":8,"MaxCount":3,"MinCount":3,"ImageId":"5bbc21d6-c48c-4c8a-b057-fcbb164bcbf7","SubnetId":"f2ac1919-0e34-4812-8290-xxxxxx","InstancePassword":"Root23123","SecurityGroupId":"d46c7672-7ca9-4f51-bbd9-xxxxxxx","DataDiskGb":50,"ChargeType":"Daily","PurchaseTime":0,"InstanceName":"k8s-kdc-worker","InstanceNameSuffix":1,"InstanceType":"DVM1.NONE"}
&ClusterName=专属云服务器集群
&ClusterDesc=This is a kdc cluster
{
"RequestId": "308b6948-9c74-41b6-8356-7bcced1da043",
"ClusterId": "52286a83-f317-416d-820e-xxxxxxx"
}
支持使用已有的云物理主机创建容器集群。
http://kce.api.ksyun.com/?Action=CreateCluster&Version=2019-08-06
&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=测试
&MasterEtcdSeparate=True
&ExistedInstanceEpcSet.1.NodeRole=Master
&ExistedInstanceEpcSet.1.EpcPara.1={"InstanceId"="70e4807b-3ed0-4bd5-a06f-xxxxxx"}
&ExistedInstanceEpcSet.1.EpcPara.2={"InstanceId"="f3a751bb-4663-4f4f-af01-xxxxxx"}
&ExistedInstanceEpcSet.1.EpcPara.3={"InstanceId"="aadf2c78-bc56-40e3-93db-xxxxxx"}
&ExistedInstanceEpcSet.2.NodeRole=Etcd
&ExistedInstanceEpcSet.2.EpcPara.1={"InstanceId"="4c20cc6c-01e6-4215-99c5-xxxxxx"}
&ExistedInstanceEpcSet.2.EpcPara.2={"InstanceId"="39275b85-fea4-4516-b399-xxxxxx"}
&ExistedInstanceEpcSet.2.EpcPara.3={"InstanceId"="13f363f3-b108-4e60-b15c-xxxxxx"}
&ExistedInstanceEpcSet.3.NodeRole=Worker
&ExistedInstanceEpcSet.3.EpcPara.1={"InstanceId"="cd434dad-77e7-4734-b8a7-xxxxxx"}
{
"RequestId": "c79283f6-49c5-4c18-ba74-xxxxxx",
"ClusterId": "be502bb4-49e2-4572-ba63-xxxxxx"
}
纯净模式
鼠标选中内容,快速反馈问题