---
title: "Generate a new Kubeconfig file for a SKS cluster"
method: POST
path: "/sks-cluster-kubeconfig/{id}"
tags: ["cluster"]
---

# Generate a new Kubeconfig file for a SKS cluster

`POST /sks-cluster-kubeconfig/{id}`

## Request

- Base URL: `https://api-ch-gva-2.exoscale.com/v2`
- URL: `https://api-ch-gva-2.exoscale.com/v2/sks-cluster-kubeconfig/{id}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/exoscale/apis/exoscale-api/docs/sks-cluster-kubeconfig/:id/post.ts> (a function with typed inputs; its response is checked against the schema)

This operation returns a Kubeconfig file encoded in base64.

## Path parameters

- `id` string, uuid, required

## Request body

- SksKubeconfigRequest: Kubeconfig request for a SKS cluster
  - `ttl` integer: Validity in seconds of the Kubeconfig user certificate (default: 30 days)
  - `user` string, required: User name in the generated Kubeconfig. The certificate present in the Kubeconfig will also have this name set for the CN field.
  - `groups` string[], required: List of roles. The certificate present in the Kubeconfig will have these roles set in the Org field.

## Response `200`

200

- object
  - `kubeconfig` string

## Changes

- **2026-03-16** `e05707a7b346`: 2 info
  - api tag `cluster` added
  - api tag `sks` removed
- **2025-08-10** `814bf1ccd925`: 2 breaking
  - the request property `groups` became required
  - the request property `user` became required

[Operation history](https://skmtc.dev/exoscale/apis/exoscale-api/changes/sks-cluster-kubeconfig/:id/post.md)

---

[API](https://skmtc.dev/exoscale/apis/exoscale-api.md) - [All operations](https://skmtc.dev/exoscale/apis/exoscale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/exoscale/apis/exoscale-api/revisions/63da6f74c845?raw)
