このトピックでは、マネージド Kubernetes クラスターの作成方法について説明します。 クラスターのワーカーノードの数を指定する必要があります。

リクエスト情報

リクエスト行

POST /clusters HTTP/1.1 

特別なリクエストヘッダー

なし。 「パブリックリクエストヘッダー」をご参照ください。

リクエストボディ

{
    "disable_rollback": "whether or not to roll back if the cluster fails to be created",
    "name": "cluster name",
    "timeout_mins": "timeout for creating the cluster",
    "cluster_type": "cluster type, Managed Kubernetes",
    "region_id": "region",
    "vpcid": "Virtual Private Cloud (VPC) ID",
    "vswitch_ids": "IDs of VSwitches. You must set one VSwitch at least, and can set five VSwitches at most.", 
    "container_cidr": "pod Classless Inter-Domain Routing (CIDR)",
    "service_cidr": "service CIDR",
    "cloud_monitor_flags":"whether or not to install the cloud monitoring plug-in",
    "login_password": "password used to log on to the node by using SSH. Use either this parameter or the key_pair.",
    "key_pair":"key pair name. use either this parameter or login_password.",
    "worker_instance_charge_type":"worker node payment type PrePaid|PostPaid",
    "worker_period_unit":"subscription unit, which includes month and year, and takes effect only for the prepaid type.
    "worker_period":"subscription period, which takes effect only for the prepaid type",
    "worker_auto_renew":"worker node auto renew true|false",
    "worker_auto_renew_period":"worker node renew period",
    "worker_instance_types": "instance types of worker nodes",
    "worker_system_disk_category": "system disk type of worker nodes",
    "worker_system_disk_size": "system disk size of worker nodes",
    "worker_data_disk":"whether or not to mount data disks true|false",
    "data_disk_category": "data disk category",
    "worker_data_disk_size":"data disk size",
    "num_of_nodes": "number of worker nodes",
    "snat_entry": "whether or not to configure the SNATEntry",
    "public_slb":"whether to associate an EIP with the intranet SLB instace",
    "proxy_mode": "the proxy mode. Valid value: iptables|ipvs",
    "addons": "the addon. This is an object in the array format.", 
    "tags": "the tag to be add to the cluster. This is an object in the array format.",
}

リクエストボディの説明

名前 データ型 必須 説明
cluster_type string はい クラスタータイプ
key_pair string はい キーペア名。このパラメーター、またはlogin_password のどちらかを使用します。
login_password string はい SSH ログインパスワード。 パスワードは 8〜30 の文字列で、大文字、小文字、数字、記号を含めることができます。 このパラメーター、またはkey_pair のどちらかを選択します。
name string はい クラスター名。 クラスター名には、大文字、小文字、漢字、平仮名、片仮名、数字、およびハイフン (-) を含めることができます。
num_of_nodes int はい ワーカーノードの数。 値の範囲は 0〜300 です。
region_id string はい クラスターが設置されているリージョンの ID
snat_entry bool はい VPC 用に SNAT を設定するかどうか。 VPC を自動的に作成する場合、このパラメーターを true に設定する必要があります。 既存の VPC を使用してクラスターを作成する場合、アウトバウンド機能に従ってパラメーター値を設定してください。
vswitch_ids List はい VSwitch の ID。 少なくとも 1 つの VSwitch を設定する必要があり、最大 3 つの VSwitch を設定できます。
worker_system_disk_category string はい ワーカーノードに接続されるシステムディスクのタイプ。
worker_system_disk_size int はい ワーカーノードに接続されるシステムディスクのサイズ (GiB 単位)。
addons list いいえ Kubernetes クラスターにインストールされるアドオン。
  • アドオンには次のパラメーターが必要です。
    • name:必須。
    • version: オプション。 デフォルトでは、最新バージョンが使用されます。
    • config:オプション。
  • Network plugin:Flannel または Terway を選択します。
  • Log Service plugin: オプション 。 このプラグインをインストールしないと、クラスターの監査ログを収集できません。
container_cidr string いいえ VPC CIDR ブロックと重複できないポッド CIDR ブロック。システムが VPC を自動的に作成できるようにする場合、172.16.0.0/16 ポッド CIDR ブロックが、デフォルトで使用されます。
cloud_monitor_flags bool いいえ クラウドモニタリングプラグインをインストールするかどうか。
disable_rollback bool いいえ クラウドモニタリングプラグインをインストールするかどうか。
  • true:プラグインをインストールすることを示します。
  • false:プラグインをインストールしないことを示します。
proxy_mode string いいえ kube-proxy モード。 iptables および ipvs モードに対応しています。 デフォルトは iptables です。
public_slb bool いいえ インターネット API サーバーを有効にするかどうか。
  • true:インターネット API サーバーを有効にすることを示します。 デフォルト値です。
  • true:インターネット API サーバーを有効にしないことを示します。 この値を選択すると、イントラネット API サーバーのみが作成されます。
service_cidr string いいえ VPC CIDR ブロックまたはポッド CIDR ブロックとオーバーラップできないサービス CIDR ブロック。システムが VPC を自動的に作成できるようにする場合、デフォルトで 172.19.0.0/20 サービス CIDR ブロックが使用されます。
tags list いいえ クラスターに追加されるタグ。
  • key:タグ名。
  • value:タグ値。
timeout_mins int いいえ クラスターリソーススタックを作成するためのタイムアウト (分)。 デフォルト値は 60 です。
vpcid string いいえ VPC ID。空でもかまいません。 VPC を設定しない場合、システムは CIDR ブロック 192.168.0.0/16 に属する VPC を自動的に作成します。
vpcid パラメーターと vswitchid パラメーターの両方を、空または関連する値に設定する必要があります。
worker_auto_renew bool いいえ ワーカーノードの自動更新を有効にするかどうか。 有効値:
  • true:自動更新を有効にすることを示します。
  • false:自動更新を有効にしないことを示します。
worker_auto_renew_period int いいえ 自動更新期間。 このパラメーター設定は、PrePaid 支払いタイプを選択して自動更新を有効にした場合にのみ有効になり、必要になります。 サブスクリプション期間単位で使用可能な値は次のとおりです。
  • PeriodUnit=Week の場合 {“1”, “2”, “3”}
  • PeriodUnit=Month の場合 {“1”, “2”, “3”, “6”, “12”}
worker_data_disk string いいえ データディスクを追加するかどうか。 有効値:
  • true:データディスクをワーカーノードにマウントすることを示します。
  • false:データディスクをワーカーノードにマウントしないことを示します。
worker_data_disk_category int いいえ データディスクタイプ
worker_data_disk_size string いいえ データディスクサイズ
worker_instance_charge_type string いいえ ワーカーノードの支払いタイプ。
  • PrePaid:サブスクリプションです。
  • PostPaid:従量課金です。
worker_period int いいえ サブスクリプション期間。 このパラメーター設定は、worker_instance_charge_type 値が PrePaid に設定されている場合にのみ有効になり、必要になります。 サブスクリプション期間単位のパラメーター値は次のとおりです。
  • PeriodUnit=Week の場合 {“1”, “2”, “3”, “4”}
  • PeriodUnit=Month の場合 { “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “12”, “24”, “36”,”48”,”60”}
worker_period_unit string いいえ ワーカーノードの自動更新を有効にするかどうか。 有効値:
  • true: 自動更新を有効にすることを示します。
  • false: 自動更新を有効にしないことを示します。

レスポンス情報

レスポンス行

HTTP/1.1 202 Accepted

特別なレスポンスヘッダー

なし。 「パブリックレスポンスヘッダー」をご参照ください。

レスポンスボディ

{
"cluster_id":"string",
"request_id":"string",
"task_id":"string"
}

リクエストの例

POST /clusters HTTP/1.1
<パブリックリクエストヘッダー>
{
"name":"test",
"cluster_type":"my-test-Kubernetes-cluster",
"disable_rollback":true,
"timeout_mins":60,
"kubernetes_version":"1.12.6-aliyun.1",
"region_id":"cn-beijing",
"snat_entry":true,
"cloud_monitor_flags":false,
"public_slb":false,
"node_cidr_mask":"25",
"proxy_mode":"ipvs",
"tags":[],
"addons":[{"name":"flannel"}, {"name":"nginx-ingress-controller"}],
"worker_instance_types":["ecs.hfc5.xlarge"],
"num_of_nodes":3,
"worker_system_disk_category":"cloud_efficiency",
"worker_system_disk_size":120,
"worker_instance_charge_type":"PostPaid",
"vpcid":"vpc-2zegvl5etah5requ09nec",
"container_cidr":"172.20.0.0/16",
"service_cidr":"172.21.0.0/20",
"vswitch_ids":["vsw-2ze48rkq464rsdts1****"],
"login_password":"test@19****"
}

レスポンスの例

HTTP/1.1 202 Accepted
<パブリックレスポンスヘッダー>
{
    "cluster_id": "cb95aa626a47740afbf6aa099b65****",
    "request_id": "687C5BAA-D103-4993-884B-C35E4314A1E1",
    "task_id": "T-5a54309c80282e39ea00002f"
}