> For the complete documentation index, see [llms.txt](https://docs.duplocloud.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duplocloud.com/docs/automation-platform/kubernetes-overview/kubectl/kubectl-token.md).

# Kubectl Tokens and Access Management

Set up KubeCtl within the DuploCloud Portal by downloading the token and configuring Mirantis Lens for DuploCloud authentication.

## 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="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FaQtkMNmCyZRwekNztMZI%2FScreenshot%20(349).png?alt=media&amp;token=68e89d2f-5d15-4b3e-b65c-2e43fd8ad4ec" 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="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FuhCyTObA6ZEzn5Mt8ldQ%2Fimage.png?alt=media&amp;token=a4f8febb-2380-4efa-99ca-ad8f077327b7" 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="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FyQOSJ6jH8rNlO2iE7cuy%2FKUBECTL.png?alt=media&amp;token=896738fc-82c5-4dae-ab1f-64c480fd4ebd" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
