> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scitix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Accessing a CKS cluster using KubeConfig

> Obtain the KubeConfig for a CKS cluster and use kubectl to access the cluster from a local terminal or operations environment.

KubeConfig stores the cluster address and authentication information required to access a CKS cluster. After obtaining and configuring KubeConfig, you can use kubectl to connect to the cluster from a local terminal or O\&M environment.

## When KubeConfig Is Required

KubeConfig tells kubectl which cluster to connect to and which identity to use to access the cluster. Common uses include:

* Use kubectl to view and manage cluster resources.
* Provide access credentials for O\&M scripts or automated workflows that need to connect to the cluster.

> [!WARNING]
>
> KubeConfig is an access credential. Do not commit it to public repositories or public documents, and do not share it with unauthorized personnel.

## Select a Retrieval Method

Before you begin, log in to the [GPU Cloud console](https://console.scitix.ai/gpu-cloud/home) and go to the **Clusters** page.

### Obtain from the cluster workspace

1. Click the target cluster name to go to the cluster workspace.

2. In the left navigation pane, go to the **Permissions** page.

3. Switch to the **KubeConfig Manage** tab.

4. Locate the target user, then generate or view the KubeConfig as needed.

### Obtain from cluster details

1. On the **Clusters** page, locate the target cluster and click **Details**.

2. Switch to the **Connect Info** tab.

3. Under **Access Method**, select **Intranet Access** or **Public Access**.

4. Click **Copy** to copy the KubeConfig content, or click the download icon to download the configuration file.

## Configure KubeConfig in the Access Environment

Before using KubeConfig, install kubectl in the access environment.

Save the KubeConfig content to `$HOME/.kube/config`, then run the following command to confirm that kubectl can read the cluster nodes:

```bash theme={null}
kubectl get nodes
```

If the configuration file is saved in another path, use `--kubeconfig` to specify the file:

```bash theme={null}
kubectl --kubeconfig <KUBECONFIG_FILE> get nodes
```

## Renew KubeConfig

When a KubeConfig is nearing expiration and still needs to be used, you can extend its validity period before it expires to prevent clients, O\&M scripts, or automated workflows that rely on the credential from being unable to access the cluster due to credential expiration.

1. On the **Permissions** page, under the **KubeConfig Manage** tab, locate the KubeConfig that needs to be renewed.

2. In the **Actions** column, click **Renew**.

3. In the dialog box that appears, select the number of renewal days.

4. Click **OK**.

5. Return to the **KubeConfig Manage** tab and confirm that the KubeConfig expiration time has been updated.

## Stop Using KubeConfig

> [!WARNING]
>
> After the KubeConfig is deleted, clients using it will no longer be able to access the cluster. Before deleting it, confirm that no automated tasks, O\&M scripts, or business processes are still using these credentials.

1. On the **Permissions** page, under the **KubeConfig Manage** tab, locate the target KubeConfig.

2. Click **Delete** and confirm as prompted.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.