import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
task_id_list = client.cloud.k8s.clusters.create(
project_id=1,
region_id=7,
keypair="some_keypair",
name="string",
pools=[{
"flavor_id": "g1-standard-1-2",
"min_node_count": 3,
"name": "my-pool",
}],
version="1.28.1",
)
print(task_id_list.tasks)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
taskIDList, err := client.Cloud.K8S.Clusters.New(context.TODO(), cloud.K8SClusterNewParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(7),
Keypair: "some_keypair",
Name: "string",
Pools: []cloud.K8SClusterNewParamsPool{{
FlavorID: "g1-standard-1-2",
MinNodeCount: 3,
Name: "my-pool",
}},
Version: "1.28.1",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", taskIDList.Tasks)
}
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": "some_keypair",
"name": "string",
"pools": [
{
"flavor_id": "g1-standard-1-2",
"min_node_count": 3,
"name": "my-pool",
"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,
"security_group_ids": [
"e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce"
],
"taints": {
"my-taint": "bar:NoSchedule"
}
}
],
"version": "1.28.1",
"add_ons": {
"slurm": {
"enabled": true,
"file_share_id": "cbc94d0e-06c6-4d12-9e86-9782ba14fc8c",
"ssh_key_ids": [
"25735292-bd97-44b0-a1af-d7eab876261d",
"efc01f3a-35b9-4385-89f9-e38439093ee7"
],
"worker_count": 2
}
},
"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": {
"cni_exclusive": true,
"encryption": true,
"hubble_relay": true,
"hubble_ui": true,
"lb_acceleration": true,
"lb_mode": "snat",
"tunnel": "geneve"
},
"provider": "cilium"
},
"csi": {
"nfs": {
"ddn_enabled": false,
"vast_enabled": true
}
},
"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"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
keypair: 'some_keypair',
name: 'string',
pools: [
{
flavor_id: 'g1-standard-1-2',
min_node_count: 3,
name: 'my-pool',
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,
security_group_ids: ['e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce'],
taints: {'my-taint': 'bar:NoSchedule'}
}
],
version: '1.28.1',
add_ons: {
slurm: {
enabled: true,
file_share_id: 'cbc94d0e-06c6-4d12-9e86-9782ba14fc8c',
ssh_key_ids: ['25735292-bd97-44b0-a1af-d7eab876261d', 'efc01f3a-35b9-4385-89f9-e38439093ee7'],
worker_count: 2
}
},
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: {
cni_exclusive: true,
encryption: true,
hubble_relay: true,
hubble_ui: true,
lb_acceleration: true,
lb_mode: 'snat',
tunnel: 'geneve'
},
provider: 'cilium'
},
csi: {nfs: {ddn_enabled: false, vast_enabled: true}},
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'
})
};
fetch('https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'keypair' => 'some_keypair',
'name' => 'string',
'pools' => [
[
'flavor_id' => 'g1-standard-1-2',
'min_node_count' => 3,
'name' => 'my-pool',
'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,
'security_group_ids' => [
'e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce'
],
'taints' => [
'my-taint' => 'bar:NoSchedule'
]
]
],
'version' => '1.28.1',
'add_ons' => [
'slurm' => [
'enabled' => true,
'file_share_id' => 'cbc94d0e-06c6-4d12-9e86-9782ba14fc8c',
'ssh_key_ids' => [
'25735292-bd97-44b0-a1af-d7eab876261d',
'efc01f3a-35b9-4385-89f9-e38439093ee7'
],
'worker_count' => 2
]
],
'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' => [
'cni_exclusive' => true,
'encryption' => true,
'hubble_relay' => true,
'hubble_ui' => true,
'lb_acceleration' => true,
'lb_mode' => 'snat',
'tunnel' => 'geneve'
],
'provider' => 'cilium'
],
'csi' => [
'nfs' => [
'ddn_enabled' => false,
'vast_enabled' => true
]
],
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"keypair\": \"some_keypair\",\n \"name\": \"string\",\n \"pools\": [\n {\n \"flavor_id\": \"g1-standard-1-2\",\n \"min_node_count\": 3,\n \"name\": \"my-pool\",\n \"auto_healing_enabled\": true,\n \"boot_volume_size\": 50,\n \"boot_volume_type\": \"ssd_hiiops\",\n \"crio_config\": {\n \"default-ulimits\": \"nofile=1024:2048\"\n },\n \"is_public_ipv4\": true,\n \"kubelet_config\": {\n \"podMaxPids\": \"4096\"\n },\n \"labels\": {\n \"my-label\": \"foo\"\n },\n \"max_node_count\": 5,\n \"security_group_ids\": [\n \"e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce\"\n ],\n \"taints\": {\n \"my-taint\": \"bar:NoSchedule\"\n }\n }\n ],\n \"version\": \"1.28.1\",\n \"add_ons\": {\n \"slurm\": {\n \"enabled\": true,\n \"file_share_id\": \"cbc94d0e-06c6-4d12-9e86-9782ba14fc8c\",\n \"ssh_key_ids\": [\n \"25735292-bd97-44b0-a1af-d7eab876261d\",\n \"efc01f3a-35b9-4385-89f9-e38439093ee7\"\n ],\n \"worker_count\": 2\n }\n },\n \"authentication\": {\n \"oidc\": {\n \"client_id\": \"kubernetes\",\n \"groups_claim\": \"groups\",\n \"groups_prefix\": \"oidc:\",\n \"issuer_url\": \"https://accounts.provider.example\",\n \"required_claims\": {\n \"claim\": \"value\"\n },\n \"signing_algs\": [\n \"RS256\",\n \"RS512\"\n ],\n \"username_claim\": \"sub\",\n \"username_prefix\": \"oidc:\"\n }\n },\n \"autoscaler_config\": {\n \"scale-down-unneeded-time\": \"5m\"\n },\n \"cni\": {\n \"cilium\": {\n \"cni_exclusive\": true,\n \"encryption\": true,\n \"hubble_relay\": true,\n \"hubble_ui\": true,\n \"lb_acceleration\": true,\n \"lb_mode\": \"snat\",\n \"tunnel\": \"geneve\"\n },\n \"provider\": \"cilium\"\n },\n \"csi\": {\n \"nfs\": {\n \"ddn_enabled\": false,\n \"vast_enabled\": true\n }\n },\n \"ddos_profile\": {\n \"enabled\": true,\n \"fields\": [\n {\n \"base_field\": 10,\n \"field_value\": [\n 45046,\n 45047\n ]\n }\n ],\n \"profile_template\": 29\n },\n \"fixed_network\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"fixed_subnet\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_ipv6\": true,\n \"logging\": {\n \"destination_region_id\": 1,\n \"enabled\": true,\n \"retention_policy\": {\n \"period\": 45\n },\n \"topic_name\": \"my-log-name\"\n },\n \"pods_ip_pool\": \"172.16.0.0/18\",\n \"pods_ipv6_pool\": \"2a03:90c0:88:393::/64\",\n \"services_ip_pool\": \"172.24.0.0/18\",\n \"services_ipv6_pool\": \"2a03:90c0:88:381::/108\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"keypair\": \"some_keypair\",\n \"name\": \"string\",\n \"pools\": [\n {\n \"flavor_id\": \"g1-standard-1-2\",\n \"min_node_count\": 3,\n \"name\": \"my-pool\",\n \"auto_healing_enabled\": true,\n \"boot_volume_size\": 50,\n \"boot_volume_type\": \"ssd_hiiops\",\n \"crio_config\": {\n \"default-ulimits\": \"nofile=1024:2048\"\n },\n \"is_public_ipv4\": true,\n \"kubelet_config\": {\n \"podMaxPids\": \"4096\"\n },\n \"labels\": {\n \"my-label\": \"foo\"\n },\n \"max_node_count\": 5,\n \"security_group_ids\": [\n \"e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce\"\n ],\n \"taints\": {\n \"my-taint\": \"bar:NoSchedule\"\n }\n }\n ],\n \"version\": \"1.28.1\",\n \"add_ons\": {\n \"slurm\": {\n \"enabled\": true,\n \"file_share_id\": \"cbc94d0e-06c6-4d12-9e86-9782ba14fc8c\",\n \"ssh_key_ids\": [\n \"25735292-bd97-44b0-a1af-d7eab876261d\",\n \"efc01f3a-35b9-4385-89f9-e38439093ee7\"\n ],\n \"worker_count\": 2\n }\n },\n \"authentication\": {\n \"oidc\": {\n \"client_id\": \"kubernetes\",\n \"groups_claim\": \"groups\",\n \"groups_prefix\": \"oidc:\",\n \"issuer_url\": \"https://accounts.provider.example\",\n \"required_claims\": {\n \"claim\": \"value\"\n },\n \"signing_algs\": [\n \"RS256\",\n \"RS512\"\n ],\n \"username_claim\": \"sub\",\n \"username_prefix\": \"oidc:\"\n }\n },\n \"autoscaler_config\": {\n \"scale-down-unneeded-time\": \"5m\"\n },\n \"cni\": {\n \"cilium\": {\n \"cni_exclusive\": true,\n \"encryption\": true,\n \"hubble_relay\": true,\n \"hubble_ui\": true,\n \"lb_acceleration\": true,\n \"lb_mode\": \"snat\",\n \"tunnel\": \"geneve\"\n },\n \"provider\": \"cilium\"\n },\n \"csi\": {\n \"nfs\": {\n \"ddn_enabled\": false,\n \"vast_enabled\": true\n }\n },\n \"ddos_profile\": {\n \"enabled\": true,\n \"fields\": [\n {\n \"base_field\": 10,\n \"field_value\": [\n 45046,\n 45047\n ]\n }\n ],\n \"profile_template\": 29\n },\n \"fixed_network\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"fixed_subnet\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_ipv6\": true,\n \"logging\": {\n \"destination_region_id\": 1,\n \"enabled\": true,\n \"retention_policy\": {\n \"period\": 45\n },\n \"topic_name\": \"my-log-name\"\n },\n \"pods_ip_pool\": \"172.16.0.0/18\",\n \"pods_ipv6_pool\": \"2a03:90c0:88:393::/64\",\n \"services_ip_pool\": \"172.24.0.0/18\",\n \"services_ipv6_pool\": \"2a03:90c0:88:381::/108\"\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}Create k8s cluster
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
task_id_list = client.cloud.k8s.clusters.create(
project_id=1,
region_id=7,
keypair="some_keypair",
name="string",
pools=[{
"flavor_id": "g1-standard-1-2",
"min_node_count": 3,
"name": "my-pool",
}],
version="1.28.1",
)
print(task_id_list.tasks)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
taskIDList, err := client.Cloud.K8S.Clusters.New(context.TODO(), cloud.K8SClusterNewParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(7),
Keypair: "some_keypair",
Name: "string",
Pools: []cloud.K8SClusterNewParamsPool{{
FlavorID: "g1-standard-1-2",
MinNodeCount: 3,
Name: "my-pool",
}},
Version: "1.28.1",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", taskIDList.Tasks)
}
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": "some_keypair",
"name": "string",
"pools": [
{
"flavor_id": "g1-standard-1-2",
"min_node_count": 3,
"name": "my-pool",
"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,
"security_group_ids": [
"e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce"
],
"taints": {
"my-taint": "bar:NoSchedule"
}
}
],
"version": "1.28.1",
"add_ons": {
"slurm": {
"enabled": true,
"file_share_id": "cbc94d0e-06c6-4d12-9e86-9782ba14fc8c",
"ssh_key_ids": [
"25735292-bd97-44b0-a1af-d7eab876261d",
"efc01f3a-35b9-4385-89f9-e38439093ee7"
],
"worker_count": 2
}
},
"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": {
"cni_exclusive": true,
"encryption": true,
"hubble_relay": true,
"hubble_ui": true,
"lb_acceleration": true,
"lb_mode": "snat",
"tunnel": "geneve"
},
"provider": "cilium"
},
"csi": {
"nfs": {
"ddn_enabled": false,
"vast_enabled": true
}
},
"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"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
keypair: 'some_keypair',
name: 'string',
pools: [
{
flavor_id: 'g1-standard-1-2',
min_node_count: 3,
name: 'my-pool',
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,
security_group_ids: ['e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce'],
taints: {'my-taint': 'bar:NoSchedule'}
}
],
version: '1.28.1',
add_ons: {
slurm: {
enabled: true,
file_share_id: 'cbc94d0e-06c6-4d12-9e86-9782ba14fc8c',
ssh_key_ids: ['25735292-bd97-44b0-a1af-d7eab876261d', 'efc01f3a-35b9-4385-89f9-e38439093ee7'],
worker_count: 2
}
},
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: {
cni_exclusive: true,
encryption: true,
hubble_relay: true,
hubble_ui: true,
lb_acceleration: true,
lb_mode: 'snat',
tunnel: 'geneve'
},
provider: 'cilium'
},
csi: {nfs: {ddn_enabled: false, vast_enabled: true}},
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'
})
};
fetch('https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'keypair' => 'some_keypair',
'name' => 'string',
'pools' => [
[
'flavor_id' => 'g1-standard-1-2',
'min_node_count' => 3,
'name' => 'my-pool',
'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,
'security_group_ids' => [
'e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce'
],
'taints' => [
'my-taint' => 'bar:NoSchedule'
]
]
],
'version' => '1.28.1',
'add_ons' => [
'slurm' => [
'enabled' => true,
'file_share_id' => 'cbc94d0e-06c6-4d12-9e86-9782ba14fc8c',
'ssh_key_ids' => [
'25735292-bd97-44b0-a1af-d7eab876261d',
'efc01f3a-35b9-4385-89f9-e38439093ee7'
],
'worker_count' => 2
]
],
'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' => [
'cni_exclusive' => true,
'encryption' => true,
'hubble_relay' => true,
'hubble_ui' => true,
'lb_acceleration' => true,
'lb_mode' => 'snat',
'tunnel' => 'geneve'
],
'provider' => 'cilium'
],
'csi' => [
'nfs' => [
'ddn_enabled' => false,
'vast_enabled' => true
]
],
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"keypair\": \"some_keypair\",\n \"name\": \"string\",\n \"pools\": [\n {\n \"flavor_id\": \"g1-standard-1-2\",\n \"min_node_count\": 3,\n \"name\": \"my-pool\",\n \"auto_healing_enabled\": true,\n \"boot_volume_size\": 50,\n \"boot_volume_type\": \"ssd_hiiops\",\n \"crio_config\": {\n \"default-ulimits\": \"nofile=1024:2048\"\n },\n \"is_public_ipv4\": true,\n \"kubelet_config\": {\n \"podMaxPids\": \"4096\"\n },\n \"labels\": {\n \"my-label\": \"foo\"\n },\n \"max_node_count\": 5,\n \"security_group_ids\": [\n \"e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce\"\n ],\n \"taints\": {\n \"my-taint\": \"bar:NoSchedule\"\n }\n }\n ],\n \"version\": \"1.28.1\",\n \"add_ons\": {\n \"slurm\": {\n \"enabled\": true,\n \"file_share_id\": \"cbc94d0e-06c6-4d12-9e86-9782ba14fc8c\",\n \"ssh_key_ids\": [\n \"25735292-bd97-44b0-a1af-d7eab876261d\",\n \"efc01f3a-35b9-4385-89f9-e38439093ee7\"\n ],\n \"worker_count\": 2\n }\n },\n \"authentication\": {\n \"oidc\": {\n \"client_id\": \"kubernetes\",\n \"groups_claim\": \"groups\",\n \"groups_prefix\": \"oidc:\",\n \"issuer_url\": \"https://accounts.provider.example\",\n \"required_claims\": {\n \"claim\": \"value\"\n },\n \"signing_algs\": [\n \"RS256\",\n \"RS512\"\n ],\n \"username_claim\": \"sub\",\n \"username_prefix\": \"oidc:\"\n }\n },\n \"autoscaler_config\": {\n \"scale-down-unneeded-time\": \"5m\"\n },\n \"cni\": {\n \"cilium\": {\n \"cni_exclusive\": true,\n \"encryption\": true,\n \"hubble_relay\": true,\n \"hubble_ui\": true,\n \"lb_acceleration\": true,\n \"lb_mode\": \"snat\",\n \"tunnel\": \"geneve\"\n },\n \"provider\": \"cilium\"\n },\n \"csi\": {\n \"nfs\": {\n \"ddn_enabled\": false,\n \"vast_enabled\": true\n }\n },\n \"ddos_profile\": {\n \"enabled\": true,\n \"fields\": [\n {\n \"base_field\": 10,\n \"field_value\": [\n 45046,\n 45047\n ]\n }\n ],\n \"profile_template\": 29\n },\n \"fixed_network\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"fixed_subnet\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_ipv6\": true,\n \"logging\": {\n \"destination_region_id\": 1,\n \"enabled\": true,\n \"retention_policy\": {\n \"period\": 45\n },\n \"topic_name\": \"my-log-name\"\n },\n \"pods_ip_pool\": \"172.16.0.0/18\",\n \"pods_ipv6_pool\": \"2a03:90c0:88:393::/64\",\n \"services_ip_pool\": \"172.24.0.0/18\",\n \"services_ipv6_pool\": \"2a03:90c0:88:381::/108\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v2/k8s/clusters/{project_id}/{region_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"keypair\": \"some_keypair\",\n \"name\": \"string\",\n \"pools\": [\n {\n \"flavor_id\": \"g1-standard-1-2\",\n \"min_node_count\": 3,\n \"name\": \"my-pool\",\n \"auto_healing_enabled\": true,\n \"boot_volume_size\": 50,\n \"boot_volume_type\": \"ssd_hiiops\",\n \"crio_config\": {\n \"default-ulimits\": \"nofile=1024:2048\"\n },\n \"is_public_ipv4\": true,\n \"kubelet_config\": {\n \"podMaxPids\": \"4096\"\n },\n \"labels\": {\n \"my-label\": \"foo\"\n },\n \"max_node_count\": 5,\n \"security_group_ids\": [\n \"e6ea8f35-82ce-4fb2-b51c-6a24a3a23bce\"\n ],\n \"taints\": {\n \"my-taint\": \"bar:NoSchedule\"\n }\n }\n ],\n \"version\": \"1.28.1\",\n \"add_ons\": {\n \"slurm\": {\n \"enabled\": true,\n \"file_share_id\": \"cbc94d0e-06c6-4d12-9e86-9782ba14fc8c\",\n \"ssh_key_ids\": [\n \"25735292-bd97-44b0-a1af-d7eab876261d\",\n \"efc01f3a-35b9-4385-89f9-e38439093ee7\"\n ],\n \"worker_count\": 2\n }\n },\n \"authentication\": {\n \"oidc\": {\n \"client_id\": \"kubernetes\",\n \"groups_claim\": \"groups\",\n \"groups_prefix\": \"oidc:\",\n \"issuer_url\": \"https://accounts.provider.example\",\n \"required_claims\": {\n \"claim\": \"value\"\n },\n \"signing_algs\": [\n \"RS256\",\n \"RS512\"\n ],\n \"username_claim\": \"sub\",\n \"username_prefix\": \"oidc:\"\n }\n },\n \"autoscaler_config\": {\n \"scale-down-unneeded-time\": \"5m\"\n },\n \"cni\": {\n \"cilium\": {\n \"cni_exclusive\": true,\n \"encryption\": true,\n \"hubble_relay\": true,\n \"hubble_ui\": true,\n \"lb_acceleration\": true,\n \"lb_mode\": \"snat\",\n \"tunnel\": \"geneve\"\n },\n \"provider\": \"cilium\"\n },\n \"csi\": {\n \"nfs\": {\n \"ddn_enabled\": false,\n \"vast_enabled\": true\n }\n },\n \"ddos_profile\": {\n \"enabled\": true,\n \"fields\": [\n {\n \"base_field\": 10,\n \"field_value\": [\n 45046,\n 45047\n ]\n }\n ],\n \"profile_template\": 29\n },\n \"fixed_network\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"fixed_subnet\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"is_ipv6\": true,\n \"logging\": {\n \"destination_region_id\": 1,\n \"enabled\": true,\n \"retention_policy\": {\n \"period\": 45\n },\n \"topic_name\": \"my-log-name\"\n },\n \"pods_ip_pool\": \"172.16.0.0/18\",\n \"pods_ipv6_pool\": \"2a03:90c0:88:393::/64\",\n \"services_ip_pool\": \"172.24.0.0/18\",\n \"services_ipv6_pool\": \"2a03:90c0:88:381::/108\"\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}Authorizations
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
1
Region ID
7
Body
The keypair of the cluster
1 - 255^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,61}[a-zA-Z0-9._]$"some_keypair"
The name of the cluster
1 - 20^[a-z][a-z0-9\-]{0,18}[a-z0-9]$"string"
The pools of the cluster
1Show child attributes
Show child attributes
The version of the k8s cluster
"1.28.1"
Cluster add-ons configuration
Show child attributes
Show child attributes
{
"slurm": {
"enabled": true,
"file_share_id": "cbc94d0e-06c6-4d12-9e86-9782ba14fc8c",
"ssh_key_ids": [
"25735292-bd97-44b0-a1af-d7eab876261d",
"efc01f3a-35b9-4385-89f9-e38439093ee7"
],
"worker_count": 2
}
}
Authentication settings
Show child attributes
Show child attributes
{
"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:"
}
}
Cluster autoscaler configuration.
It allows you to override the default cluster-autoscaler parameters provided by the platform with your preferred values.
Supported parameters (in alphabetical order):
- balance-similar-node-groups (boolean: true/false) - Detect similar node groups and balance the number of nodes between them.
- expander (string: random, most-pods, least-waste, price, priority, grpc) - Type of node group expander to be used in scale up. Specifying multiple values separated by commas will call the expanders in succession until there is only one option remaining.
- expendable-pods-priority-cutoff (float) - Pods with priority below cutoff will be expendable. They can be killed without any consideration during scale down and they don't cause scale up. Pods with null priority (PodPriority disabled) are non expendable.
- ignore-daemonsets-utilization (boolean: true/false) - Should CA ignore DaemonSet pods when calculating resource utilization for scaling down.
- max-empty-bulk-delete (integer) - Maximum number of empty nodes that can be deleted at the same time.
- max-graceful-termination-sec (integer) - Maximum number of seconds CA waits for pod termination when trying to scale down a node.
- max-node-provision-time (duration: e.g., '15m') - The default maximum time CA waits for node to be provisioned - the value can be overridden per node group.
- max-total-unready-percentage (float) - Maximum percentage of unready nodes in the cluster. After this is exceeded, CA halts operations.
- new-pod-scale-up-delay (duration: e.g., '10s') - Pods less than this old will not be considered for scale-up. Can be increased for individual pods through annotation.
- ok-total-unready-count (integer) - Number of allowed unready nodes, irrespective of max-total-unready-percentage.
- scale-down-delay-after-add (duration: e.g., '10m') - How long after scale up that scale down evaluation resumes.
- scale-down-delay-after-delete (duration: e.g., '10s') - How long after node deletion that scale down evaluation resumes.
- scale-down-delay-after-failure (duration: e.g., '3m') - How long after scale down failure that scale down evaluation resumes.
- scale-down-enabled (boolean: true/false) - Should CA scale down the cluster.
- scale-down-unneeded-time (duration: e.g., '10m') - How long a node should be unneeded before it is eligible for scale down.
- scale-down-unready-time (duration: e.g., '20m') - How long an unready node should be unneeded before it is eligible for scale down.
- scale-down-utilization-threshold (float) - The maximum value between the sum of cpu requests and sum of memory requests of all pods running on the node divided by node's corresponding allocatable resource, below which a node can be considered for scale down.
- scan-interval (duration: e.g., '10s') - How often cluster is reevaluated for scale up or down.
- skip-nodes-with-custom-controller-pods (boolean: true/false) - If true cluster autoscaler will never delete nodes with pods owned by custom controllers.
- skip-nodes-with-local-storage (boolean: true/false) - If true cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath.
- skip-nodes-with-system-pods (boolean: true/false) - If true cluster autoscaler will never delete nodes with pods from kube-system (except for DaemonSet or mirror pods).
Show child attributes
Show child attributes
{ "scale-down-unneeded-time": "5m" }
Cluster CNI settings
Show child attributes
Show child attributes
{
"cilium": {
"cni_exclusive": true,
"encryption": true,
"hubble_relay": true,
"hubble_ui": true,
"lb_acceleration": true,
"lb_mode": "snat",
"tunnel": "geneve"
},
"provider": "cilium"
}
Container Storage Interface (CSI) driver settings
Show child attributes
Show child attributes
{
"nfs": {
"ddn_enabled": false,
"vast_enabled": true
}
}
Advanced DDoS Protection profile
Show child attributes
Show child attributes
{
"enabled": true,
"fields": [
{
"base_field": 10,
"field_value": [45046, 45047]
}
],
"profile_template": 29
}
The network of the cluster
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
The subnet of the cluster
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
Enable public v6 address
true
Logging configuration
Show child attributes
Show child attributes
{
"destination_region_id": 1,
"enabled": true,
"retention_policy": { "period": 45 },
"topic_name": "my-log-name"
}
The IP pool for the pods
"172.16.0.0/18"
The IPv6 pool for the pods
"2a03:90c0:88:393::/64"
The IP pool for the services
"172.24.0.0/18"
The IPv6 pool for the services
"2a03:90c0:88:381::/108"
Response
OK
List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:
GET /v1/tasks/{task_id}- Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.
["d478ae29-dedc-4869-82f0-96104425f565"]
Was this page helpful?