Create cluster

Prev Next

Available in VPC

Create a new cluster based on the entered information.

Request

This section describes the request format. The method and URI are as follows:

Method URI
POST /clusters

Request headers

For information about the headers common to all Ncloud Kubernetes Service APIs, see Common Ncloud Kubernetes Service 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"
  },
  "authType": "String",
  "bootstrapAccessEntry": "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

You can include the following data in the body of your request:

Field Type Required Description
name String Required Cluster 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.
clusterType String Required Cluster type
  • XEN
    • 10 EA: SVR.VNKS.STAND.C002.M008.NET.SSD.B050.G002
    • 50 EA: SVR.VNKS.STAND.C004.M016.NET.SSD.B050.G002
  • KVM
    • 250 EA: SVR.VNKS.STAND.C004.M016.G003
k8sVersion String Optional Kubernetes version
loginKeyName String Required Authentication key name
  • Enter the name of the authentication key you have.
hypervisorCode String Optional Hypervisor type
  • XEN (default) | KVM
regionCode String Required Region code
zoneCode String Conditional Zone code
  • Required if zoneNo is not entered
  • Check through the getZoneList action.
zoneNo String Conditional Zone number
  • Required if zoneCode is not entered
  • Check through the getZoneList action.
publicNetwork Boolean Optional Subnet network type
  • true | false (default)
  • true: public
  • false: private
  • vpcNo Integer Required Number of VPC where the cluster will be placed in
    • Check through the console or the getVpcList action.
    subnetNoList[] Array Required Subnet 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.
    subnetLbNo Integer Conditional @deprecated Private subnet number dedicated to load balancer
    lbPrivateSubnetNo Integer Conditional Number of load balancer-only private subnet to apply to the cluster
    lbPublicSubnetNo Integer Required Number of load balancer-only public subnet to apply to the cluster
    log Object Optional
    log.audit Boolean Optional Set audit log
    • true | false (default)
    authType String Optional Cluster authentication method
    • API (default) | CONFIG_MAP
    bootstrapAccessEntry Boolean Optional Whether to automatically create a bootstrap access entry when creating a cluster
    • true (default) | false
    kmsKeyTag String Optional Key Management Service's key tag
    nodePool[] Array Optional List of NodePools to add
    nodePool[].name String Optional NodePool name
    nodePool[].nodeCount Integer Optional Number of nodes
    nodePool[].subnetNo Integer Optional @deprecated Subnet number
    nodePool[].subnetNoList[] Array Optional Subnet number
    • Valid range: cluster subnetNoList
    nodePool[].softwareCode String Optional Server image code
    nodePool[].productCode String Optional Service code
    nodePool[].labels[] Array Optional Node label list
    nodePool[].labels[].key String Conditional Label 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[].value String Conditional Label 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[] Array Optional List of taints
    nodePool[].taints[].key String Conditional Taint 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[].value String Optional Taint value
    • English letters, numbers, special characters "-", "_", "." are allowed, and the string must start and end with a English letter or number.
    nodePool[].taints[].effect String Conditional taint effect
    • Required when entering nodePool[].taints
    • NoSchedule | PreferNoSchedule | NoExecute
    nodePool[].serverSpecCode String Optional Server type
    nodePool[].storageSize Integer Optional Storage size
    • Use only for hypervisorCode KVM
    • Valid range: 100 (default)-2000 GB
    nodePool[].serverRoleId String Optional ID to assign roles to NodePool servers
    nodePool[].fabricCluster Object Conditional Fabric cluster information
    • Required when using server specifications that support Fabric clusters
    nodePool[].fabricCluster.poolName String Conditional Fabric cluster pool information
    • Required when configuring Fabric cluster
    nodePool[].fabricCluster.poolNo Integer Conditional Fabric cluster pool number
    • Required when configuring Fabric cluster

    Request example

    The request example is as follows:

    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

    This section describes the response format.

    Response syntax

    The response syntax is as follows:

    {
        "uuid": "String"
    }
    

    Response body

    The response body includes the following data:

    Field Type Required Description
    uuid String - UUID of the cluster

    Response status codes

    For information about the HTTP status codes common to all Ncloud Kubernetes Service APIs, see Ncloud Kubernetes Service response status codes.

    Response example

    The response example is as follows:

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