# Connect with kubectl
Source: https://docs.infraista.com/en/compute/kubernetes/connect-with-kubectl



Everything about reaching the cluster is on its **Access** tab (**Compute › Kubernetes** › the cluster
› **Access**). Downloading the kubeconfig needs permission to manage Kubernetes.

<Shot name="compute/kubernetes/access" alt="The Access tab with the kubeconfig download, API endpoint, the quickstart commands and service account tokens" />

## Download the kubeconfig [#download-the-kubeconfig]

1. Under **Kubeconfig**, select **Download**. The file gives admin access to the cluster: treat it like
   a password.
2. Follow the **Quickstart**:

```bash
# 1. Install kubectl (macOS shown; on Windows: winget install -e --id Kubernetes.kubectl)
brew install kubectl

# 2. Point kubectl at the cluster, using the file you downloaded
#    (the Quickstart shows your file's exact name)
export KUBECONFIG=~/Downloads/<your-cluster-kubeconfig-file>

# 3. Check the nodes: all of them should be Ready
kubectl get nodes
```

The card also shows the **API endpoint** and when the credentials expire.

## Rotate the admin credentials [#rotate-the-admin-credentials]

If a kubeconfig may have leaked, select **Rotate credentials** and confirm. Every kubeconfig downloaded
so far stops working. Download the new file and share it with anyone who needs it.

## Service account tokens [#service-account-tokens]

Tokens give CI, dashboards and scripts access to **one namespace**, with a role you pick:

| Role      | Can                           |
| --------- | ----------------------------- |
| **view**  | Read-only                     |
| **edit**  | Deploy and change workloads   |
| **admin** | Full control of the namespace |

1. Under **Service account tokens**, select **Create token**.
2. Enter a name, the namespace (`default` unless you change it), the role and when it expires
   (or never).
3. Copy the token now: it won't be shown again.

**Revoke** a token to cut its access straight away.

## Related [#related]

* [Node pools](/en/compute/kubernetes/node-pools)
