# Kubectl Tokens and Access Management

## Downloading a `kubectl` Token

Connect directly to your Kubernetes cluster namespace using a `kubectl` token. This facilitates direct interaction with your Kubernetes cluster through a command-line interface.

{% hint style="warning" %}
If you attempt to start a `kubectl` shell instance and receive a 503 in your web browser, ensure that the Duplo-shell Service in the Default Tenant and the Hosts that support it are running.
{% endhint %}

1. In the DuploCloud Portal, navigate to **Kubernetes** -> **Services**.
2. From the **KubeCtl** list box, select **KubeCtl Token**. The **Token** window displays. Copy the contents to your clipboard.

<figure><img src="/files/UTXHsPPyx9djn8LQljdv" alt=""><figcaption><p>The <strong>Kubernetes Services</strong> page with the <strong>KubeCtl Token</strong> option highlighted</p></figcaption></figure>

<div align="left"><img src="/files/pdBGM6cBFoqI5n3VaziR" alt="The kubectl Token window in the DuploCloud Portal"></div>

## Downloading a `kubectl` Token for Non-Administrators

If you don't have administrator privileges, configure AWS credentials for interacting with cloud resources and download a `kubectl` token tied to a service account. This token is specifically for the selected Tenant. It is designed for use with a DuploCloud service account, not for human users.

1. In the DuploCloud Portal, navigate to **Kubernetes** -> **Services**. The **Services** page displays.
2. Select the Service name from the **Name** column.
3. From the **KubeCtl** item list, select **KubeCtl Token**. The **KubeCtl Token** window displays.<br>

   <figure><img src="/files/WlXaNJS57zAiyA0sk1dM" alt=""><figcaption><p>The <strong>Token</strong> window</p></figcaption></figure>
4. Click **Copy** to copy the `kubectl` commands in the **Token** window to your clipboard.
5. From the **KubeCtl** item list, select **KubeCtl Shell** to launch the shell instance.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.duplocloud.com/docs/automation-platform/kubernetes-overview/kubectl/kubectl-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
