Skip to main content
POST
/
v1
/
regions
/
{region}
/
projects
/
{project}
/
compute
/
clusters
/
{clusterId}
/
kubeconfigs
Issue kubeconfig
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({user: '<string>', role: '<string>', ttl: 123})
};

fetch('https://api.k0rdent.ai/v1/regions/{region}/projects/{project}/compute/clusters/{clusterId}/kubeconfigs', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "selfLink": "/v1/regions/us-texas-1/projects/project-x9y8z7/compute/clusters/cluster-a1b2c3/kubeconfigs/kubeconfig-s2t3u4",
  "id": "address-j1k2l3",
  "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "displayName": "<string>",
  "description": "<string>",
  "issuedFor": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer token authentication using OAuth2/OIDC tokens

Path Parameters

region
string
required

Region identifier

project
string
required

Project identifier

clusterId
string
required

Unique cluster identifier

Body

application/json

Request to issue kubeconfig.

user
string

User identifier for kubeconfig

role
string

Role for kubeconfig permissions

ttl
integer

Time-to-live in seconds

Response

Kubeconfig issued

Kubeconfig credential resource.

Server-defined URL for this resource.

Example:

"/v1/regions/us-texas-1/projects/project-x9y8z7/compute/clusters/cluster-a1b2c3/kubeconfigs/kubeconfig-s2t3u4"

id
string

Name of the resource. Provided by the client when the resource is created, or generated by the server if not specified. Must be 1-63 characters long and match the pattern a-z? — the first character must be a lowercase letter, and all following characters must be lowercase letters, digits, or hyphens, with the last character being a letter or digit. Cannot be changed after the resource is created.

Required string length: 1 - 63
Pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:

"address-j1k2l3"

uid
string<uuid>

Server-generated UUID.

displayName
string

Optional human-friendly display name for the kubeconfig.

description
string

An optional description of this resource.

issuedFor
string

User or role for which kubeconfig was issued

createdAt
string<date-time>
expiresAt
string<date-time>

Expiration timestamp if applicable