> This page is for Self-Hosted, version v3.0 (default).
> For other versions, use one of these documentation indexes:
> - v3.0 (default): https://docs.nvidia.com/run-ai/self-hosted/v3.0/llms.txt
> - v2.26: https://docs.nvidia.com/run-ai/self-hosted/v2.26/llms.txt
> - v2.25: https://docs.nvidia.com/run-ai/self-hosted/v2.25/llms.txt
> - v2.24: https://docs.nvidia.com/run-ai/self-hosted/v2.24/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/run-ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/run-ai/_mcp/server.

# Add NVIDIA Run:ai Authorization to Kubeconfig

The `runai kubeconfig set` command allows users to configure their kubeconfig file with NVIDIA Run:ai authorization token. This setup enables users to gain access to the Kubernetes (K8s) cluster seamlessly.

<Note>

**Note**

Setting kubeconfig is not required in order to use the CLI. This command is used to enable third-party workloads under NVIDIA Run:ai authorization.

</Note>

## Usage

To set the token (will be fetched automatically) inside the kubeconfig file, run the following command:

```sh
runai kubeconfig set
```

## Prerequisites

Before executing the command, ensure that

1. [Cluster authentication](/run-ai/self-hosted/documentation/platform-management/authentication/cluster-authentication) is configured and enabled.
2. The user has a kubeconfig file configured.
3. The user is logged in (use the [runai login](/run-ai/self-hosted/reference/cli/runai/login/runai-login) command).

## User Kubeconfig Configuration

Add the following to the Kubernetes client configuration file (.`/kube/config`). For the full command reference, see [kubeconfig set](/run-ai/self-hosted/reference/cli/runai/kubeconfig/runai-kubeconfig-set).

* Make sure to replace values with the actual cluster information and user credentials.
* There can be multiple contexts in the kubeconfig file. The command will configure the current context.

```yaml
apiVersion: v1
kind: Config
preferences:
  colors: true
current-context: <CONTEXT_NAME>
contexts:
- context:
    cluster: <CLUSTER_NAME>
    user: <USER_NAME>
  name: <CONTEXT_NAME>
clusters:
- cluster:
    server: <CLUSTER_URL>
    certificate-authority-data: <CLUSTER_CERT>
  name: <CLUSTER_NAME>
users:
- name: <USER_NAME>
```