Skip to main content
POST
/
cloud
/
v2
/
k8s
/
clusters
/
{project_id}
/
{region_id}
Create k8s cluster
curl --request POST \
  --url https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "keypair": "<string>",
  "name": "<string>",
  "pools": [
    {
      "flavor_id": "<string>",
      "min_node_count": 100,
      "name": "<string>",
      "auto_healing_enabled": true,
      "boot_volume_size": 50,
      "boot_volume_type": "ssd_hiiops",
      "crio_config": {
        "default-ulimits": "nofile=1024:2048"
      },
      "is_public_ipv4": true,
      "kubelet_config": {
        "podMaxPids": "4096"
      },
      "labels": {
        "my-label": "foo"
      },
      "max_node_count": 5,
      "servergroup_policy": "affinity",
      "taints": {
        "my-taint": "bar:NoSchedule"
      }
    }
  ],
  "version": "<string>",
  "authentication": {
    "oidc": {
      "client_id": "kubernetes",
      "groups_claim": "groups",
      "groups_prefix": "oidc:",
      "issuer_url": "https://accounts.provider.example",
      "required_claims": {
        "claim": "value"
      },
      "signing_algs": [
        "RS256",
        "RS512"
      ],
      "username_claim": "sub",
      "username_prefix": "oidc:"
    }
  },
  "autoscaler_config": {
    "scale-down-unneeded-time": "5m"
  },
  "cni": {
    "cilium": {
      "encryption": true,
      "hubble_relay": true,
      "hubble_ui": true,
      "lb_acceleration": true,
      "lb_mode": "snat",
      "tunnel": "geneve"
    },
    "provider": "cilium"
  },
  "ddos_profile": {
    "enabled": true,
    "fields": [
      {
        "base_field": 10,
        "field_value": [
          45046,
          45047
        ]
      }
    ],
    "profile_template": 29
  },
  "fixed_network": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "fixed_subnet": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "is_ipv6": true,
  "logging": {
    "destination_region_id": 1,
    "enabled": true,
    "retention_policy": {
      "period": 45
    },
    "topic_name": "my-log-name"
  },
  "pods_ip_pool": "172.16.0.0/18",
  "pods_ipv6_pool": "2a03:90c0:88:393::/64",
  "services_ip_pool": "172.24.0.0/18",
  "services_ipv6_pool": "2a03:90c0:88:381::/108"
}
'
{
  "tasks": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project identifier

region_id
integer
required

Region identifier

Body

application/json
keypair
string
required

The keypair of the cluster

Required string length: 1 - 255
Example:

"some_keypair"

name
string
required

The name of the cluster

Required string length: 1 - 20
Example:

"string"

pools
K8sClusterPoolCreateV2Serializer · object[]
required

The pools of the cluster

Minimum array length: 1
version
string
required

The version of the k8s cluster

Example:

"1.28.1"

authentication
K8sClusterAuthenticationCreateV2Serializer · object

Authentication settings

Example:
{
  "oidc": {
    "client_id": "kubernetes",
    "groups_claim": "groups",
    "groups_prefix": "oidc:",
    "issuer_url": "https://accounts.provider.example",
    "required_claims": { "claim": "value" },
    "signing_algs": ["RS256", "RS512"],
    "username_claim": "sub",
    "username_prefix": "oidc:"
  }
}
autoscaler_config
Autoscaler Config · object

Cluster autoscaler configuration params

Example:
{ "scale-down-unneeded-time": "5m" }
cni
K8sClusterCNICreateV2Serializer · object

Cluster CNI settings

Example:
{
  "cilium": {
    "encryption": true,
    "hubble_relay": true,
    "hubble_ui": true,
    "lb_acceleration": true,
    "lb_mode": "snat",
    "tunnel": "geneve"
  },
  "provider": "cilium"
}
ddos_profile
K8sClusterDdosProfileCreateV2Serializer · object

Advanced DDoS Protection profile

Example:
{
  "enabled": true,
  "fields": [
    {
      "base_field": 10,
      "field_value": [45046, 45047]
    }
  ],
  "profile_template": 29
}
fixed_network
string | null
default:""

The network of the cluster

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"

fixed_subnet
string | null
default:""

The subnet of the cluster

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"

is_ipv6
boolean | null
default:false

Enable public v6 address

Example:

true

logging
K8sClusterLoggingCreateV2Serializer · object

Logging configuration

Example:
{
  "destination_region_id": 1,
  "enabled": true,
  "retention_policy": { "period": 45 },
  "topic_name": "my-log-name"
}
pods_ip_pool
string | null

The IP pool for the pods

Example:

"172.16.0.0/18"

pods_ipv6_pool
string | null

The IPv6 pool for the pods

Example:

"2a03:90c0:88:393::/64"

services_ip_pool
string | null

The IP pool for the services

Example:

"172.24.0.0/18"

services_ipv6_pool
string | null

The IPv6 pool for the services

Example:

"2a03:90c0:88:381::/108"

Response

Everything is OK, task to create cluster was created

tasks
string[]
required

List of task IDs

Example:
["d478ae29-dedc-4869-82f0-96104425f565"]