Skip to main content
GET
/
cloud
/
v2
/
k8s
/
clusters
/
{project_id}
/
{region_id}
/
{cluster_name}
/
config
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
k8s_cluster_kubeconfig = client.cloud.k8s.clusters.get_kubeconfig(
    cluster_name="my-cluster",
    project_id=1,
    region_id=7,
)
print(k8s_cluster_kubeconfig.client_certificate)
{
  "client_certificate": "<string>",
  "client_key": "<string>",
  "cluster_ca_certificate": "<string>",
  "config": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "host": "<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 ID

Example:

1

region_id
integer
required

Region ID

Example:

7

cluster_name
string
required

Cluster name

Example:

"my-cluster"

Response

200 - application/json

OK

client_certificate
string
required

String in base64 format. Cluster client certificate

client_key
string
required

String in base64 format. Cluster client key

cluster_ca_certificate
string
required

String in base64 format. Cluster ca certificate

config
string
required

Cluster kubeconfig

created_at
string<date-time>
required

Kubeconfig creation date

Example:

"2024-02-15T11:53:03Z"

expires_at
string<date-time>
required

Kubeconfig expiration date

Example:

"2026-02-15T11:53:03Z"

host
string
required

Cluster host