Create cluster
    • PDF

    Create cluster

    • PDF

    Article summary

    Available in VPC

    Create a new cluster based on the entered information.

    Request

    The following describes the request format for the endpoint. The request format is as follows:

    MethodURI
    POST/clusters

    Request headers

    For headers common to all Ncloud Kubernetes Service APIs, see Ncloud Kubernetes Service common request headers.

    Request syntax

    The request syntax is as follows.

    {
      "name": "String",
      "clusterType": "String",
      "k8sVersion": "String",
      "loginKeyName": "String",
      "hypervisorCode": "String",
      "regionCode": "String",
      "zoneCode": "String",
      "zoneNo": "Integer",
      "publicNetwork": "Boolean",
      "kubeNetworkPlugin": "String",
      "vpcNo": "Integer",
      "subnetNoList": [
        "Integer"
      ],
      "subnetLbNo": "Integer",
      "lbPrivateSubnetNo": "Integer",
      "lbPublicSubnetNo": "Integer",
      "log": {
        "audit": "Boolean"
      },
      "kmsKeyTag": "String",
      "nodePool": [
        {
          "name": "String",
          "nodeCount": "Integer",
          "subnetNo": "Integer",
          "subnetNoList": [
            "Integer"
          ],
          "softwareCode": "String",
          "productCode": "String",
          "labels": [
            {
              "key": "String",
              "value": "String"
            }
          ],
          "taints": [
            {
              "key": "String",
              "value": "String",
              "effect": "String"
            }
          ],
          "serverSpecCode": "String",
          "storageSize": "Integer",
          "serverRoleId": "String"
        }
      ]
    }
    

    Request body

    The following describes the request body.

    FieldTypeRequiredDescription
    nameStringRequiredCluster name
    • 3 to 30 characters, including letters, numbers, and the special character "-", and must begin with an English letter and end with an English letter or number
    clusterTypeStringRequiredCluster type
    k8sVersionStringOptionalKubernetes version
    loginKeyNameStringRequiredAuthentication key name
    • Enter the name of the authentication key you have
    hypervisorCodeStringOptionalHypervisor type
    • XEN (default) | KVM
    regionCodeStringRequiredRegion code
    zoneCodeStringConditionalZone code
    • Required if zoneNo is not entered
    • Check through the getZoneList action
    zoneNoStringConditionalZone number
    • Required if zoneCode is not entered
    • Check through the getZoneList action
    publicNetworkBooleanOptionalSubnet network type
    • true | false(default)
  • true: public
  • false: private
  • vpcNoIntegerRequiredNumber of VPC where the cluster will be placed in
    • Check through the console or the getVpcList action
    subnetNoList[]ArrayRequiredSubnet number list
    • Check through the getSubnetList action
    • If publicNetwork is false, enter the subnet ID of the general purpose private subnet
    • If publicNetwork if true, enter the subnet ID of the general purpose public subnet
    subnetLbNoIntegerConditional@deprecated Private subnet number dedicated to load balancer
    lbPrivateSubnetNoIntegerConditionalNumber of load balancer-only private subnet to apply to the cluster
    lbPublicSubnetNoIntegerRequiredNumber of load balancer-only public subnet to apply to the cluster
    logObjectOptional
    log.auditBooleanOptionalSet audit log
    • true | false (default)
    kmsKeyTagStringOptionalKey Management Service's key tag
    nodePool[]ArrayOptionalList of NodePools to add
    nodePool[].nameStringOptionalNodePool name
    nodePool[].nodeCountIntegerOptionalNumber of nodes
    nodePool[].subnetNoIntegerOptional@deprecated Subnet number
    nodePool[].subnetNoList[]ArrayOptionalSubnet number
    • Valid range: cluster subnetNoList
    nodePool[].softwareCodeStringOptionalServer image code
    nodePool[].productCodeStringOptionalService code
    nodePool[].labels[]ArrayOptionalNode label list
    nodePool[].labels[].keyStringConditionalLabel key
    • Required when entering nodePool[].labels
    • English letters, numbers, and special characters "-", "_", "." are allowed, and the string must start and end with a English letter or number
    nodePool[].labels[].valueStringConditionalLabel value
    • Required when entering nodePool[].labels
    • English letters, numbers, and special characters "-", "_", "." are allowed, and the string must start and end with a English letter or number
    nodePool[].taints[]ArrayOptionalList of taints
    nodePool[].taints[].keyStringConditionalTaint key
    • Required when entering nodePool[].taints
    • English letters, numbers, and special characters "-", "_", "." are allowed, and the string must start and end with a English letter or number
    nodePool[].taints[].valueStringOptionalTaint value
    • English letters, numbers, special characters "-", "_", "." are allowed, and the string must start and end with a English letter or number
    nodePool[].taints[].effectStringConditionaltaint effect
    • Required when entering nodePool[].taints
    • NoSchedule | PreferNoSchedule | NoExecute
    nodePool[].serverSpecCodeStringOptionalServer type
    nodePool[].storageSizeIntegerOptionalStorage size
    • Use only for hypervisorCode KVM
    • Valid range: 100 (default) - 2000 GB
    nodePool[].serverRoleIdStringOptionalID to assign roles to NodePool servers

    Request example

    The following is a sample request.

    curl --location --request POST 'https://nks.apigw.ntruss.com/vnks/v2/clusters' \
    --header 'x-ncp-apigw-timestamp: {Timestamp}' \
    --header 'x-ncp-iam-access-key: {Sub Account Access Key}' \
    --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
    --header 'Content-Type: application/json'
    --data '{
        "name": "String",
        "clusterType": "String",
        "k8sVersion": "String",
        "loginKeyName": "String",
        "hypervisorCode": "String",
        "regionCode": "String",
        "zoneCode": "String",
        "zoneNo": "Integer",
        "publicNetwork": "Boolean",
        "kubeNetworkPlugin": "String",
        "vpcNo": "Integer",
        "subnetNoList": [
          "Integer"
        ],
        "subnetLbNo": "Integer",
        "lbPrivateSubnetNo": "Integer",
        "lbPublicSubnetNo": "Integer",
        "log": {
          "audit": "Boolean"
        },
        "nodePool": [
          {
            "name": "String",
            "nodeCount": "Integer",
            "subnetNo": "Integer",
            "subnetNoList": [
              "Integer"
            ],
            "softwareCode": "String",
            "productCode": "String",
            "labels": [
              {
                "key": "String",
                "value": "String"
              }
            ],
            "taints": [
              {
                "key": "String",
                "value": "String",
                "effect": "String"
              }
            ],
            "serverSpecCode": "String",
            "storageSize": "Integer",
            "serverRoleId": "String"
          }
        ]
    }'
    

    Response

    The following describes the response format.

    Response syntax

    The response syntax is as follows.

    {
        "uuid": "String"
    }
    

    Response body

    The following describes the response body.

    FieldTypeRequiredDescription
    uuidString-UUID of the cluster

    Response status codes

    For response status codes common to all Ncloud Kubernetes Service APIs, see Ncloud Kubernetes Service response status codes.

    Response example

    The following is a sample example.

    {
        "uuid": "****a20e-e0fb-4dc9-af1b-97fd3f8d****"
    }
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.