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 '{
  "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,
  "keypair": "some_keypair",
  "logging": {
    "destination_region_id": 1,
    "enabled": true,
    "retention_policy": {
      "period": 45
    },
    "topic_name": "my-log-name"
  },
  "name": "string",
  "pods_ip_pool": "172.16.0.0/18",
  "pods_ipv6_pool": "2a03:90c0:88:393::/64",
  "pools": [
    {
      "auto_healing_enabled": true,
      "boot_volume_size": 50,
      "boot_volume_type": "ssd_hiiops",
      "crio_config": {
        "default-ulimits": "nofile=1024:2048"
      },
      "flavor_id": "g1-standard-1-2",
      "is_public_ipv4": true,
      "kubelet_config": {
        "podMaxPids": "4096"
      },
      "labels": {
        "my-label": "foo"
      },
      "max_node_count": 5,
      "min_node_count": 3,
      "name": "my-pool",
      "servergroup_policy": "affinity",
      "taints": {
        "my-taint": "bar:NoSchedule"
      }
    }
  ],
  "services_ip_pool": "172.24.0.0/18",
  "services_ipv6_pool": "2a03:90c0:88:381::/108",
  "version": "1.28.1"
}'
{
  "tasks": [
    "d478ae29-dedc-4869-82f0-96104425f565"
  ]
}

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
Examples:

"some_keypair"

name
string
required

The name of the cluster

Required string length: 1 - 20
Examples:

"string"

pools
K8sClusterPoolCreateV2Serializer · object[]
required

The pools of the cluster

Minimum length: 1
version
string
required

The version of the k8s cluster

Examples:

"1.28.1"

authentication
object | null

Authentication settings

Examples:
{
"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
object | null

Cluster autoscaler configuration params

Examples:
{ "scale-down-unneeded-time": "5m" }
cni
object | null

Cluster CNI settings

Examples:
{
"cilium": {
"encryption": true,
"hubble_relay": true,
"hubble_ui": true,
"lb_acceleration": true,
"lb_mode": "snat",
"tunnel": "geneve"
},
"provider": "cilium"
}
ddos_profile
object | null

Advanced DDoS Protection profile

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

The network of the cluster

Examples:

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

fixed_subnet
string | null
default:""

The subnet of the cluster

Examples:

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

is_ipv6
boolean | null
default:false

Enable public v6 address

Examples:

true

false

logging
object | null

Logging configuration

Examples:
{
"destination_region_id": 1,
"enabled": true,
"retention_policy": { "period": 45 },
"topic_name": "my-log-name"
}

null

pods_ip_pool
string | null

The IP pool for the pods

Examples:

"172.16.0.0/18"

pods_ipv6_pool
string | null

The IPv6 pool for the pods

Examples:

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

services_ip_pool
string | null

The IP pool for the services

Examples:

"172.24.0.0/18"

services_ipv6_pool
string | null

The IPv6 pool for the services

Examples:

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

Response

Task IDs for cluster creation

tasks
string[]
required

List of task IDs

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