> 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/overview-1/prerequisites/tools-tenant/enable-kubectl-shell.md).

# Enable Kubectl Shell

Enable access to the DuploCloud shell for your GCP account

Enabling kubectl shell access in GCP is part of a one-time DuploCloud Portal setup process.

## Step 1: Create a Node Pool

1. In the **Tenant** list box, select the **Tools** Tenant.
2. Navigate to **Kubernetes** -> **Nodes**.
3. Select the **Node Pool** tab, and click **Add.**

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FuExQuNr54zyRZQW9RqRZ%2Fnode%20pool%20new.png?alt=media&amp;token=89012fcc-1ae5-4f38-b9ca-e27ccdac9d41" alt=""><figcaption><p>The <strong>Add Node Pool</strong> pane</p></figcaption></figure>

4. Complete the required fields, and click **Create**.
5. Once the node pool is complete, it will display on the **GCP VM** tab with a status of **Running**.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FjnAVuFzguWeTXEEpkNje%2Fimage.png?alt=media&amp;token=ea28b00f-0a8f-41fc-a22a-62347fe22f18" alt=""><figcaption><p>The <strong>GCE VM</strong> tab in the DuploCloud Portal</p></figcaption></figure>

## Step 2. Create a DuploCloud Service

1. In the **Tenant** list box, select the **Tools** Tenant.
2. Navigate to **Kubernetes** -> **Services**.
3. Click **Add**. The **Add Service** page displays.
4. From the table below, enter the values that correspond to the fields on the **Add Service** page. Accept default values for fields not specified.

| Add Service page field | Value                                    |
| ---------------------- | ---------------------------------------- |
| **Name**               | `kubectl`                                |
| **Cloud**              | `Google`                                 |
| **Platform**           | `GKE Linux`                              |
| **Docker Image**       | `duplocloud/shell:terraform_kubectl_v15` |

4. In the **Environment Variables** field, enter the following YAML. Replace the flask app secret (b33d13ab-5b46-443d-a19d-asdfsd443 in this example) with a string of random numbers and letters in the same format and replace ***CUSTOMER\_PREFIX*** with your customer URL prefix.

```yaml
- Name: FLASK_APP_SECRET
 Value: b33d13ab-5b46-443d-a19d-asdfsd443
- Name: DUPLO_AUTH_URL
 Value: https://<CUSTOMER_PREFIX>.duplocloud.net
```

4. Click **Next**. The **Advanced Options** page displays.
5. Click **Create**. The Service is created.

## Step 3: Create a Load Balancer

1. Navigate to **Kubernetes** -> **Services**.
2. Select the **kubectl** Service from the **NAME** column.
3. Select the **Load Balancers** tab, and click **Configure Load Balancer**. The **Add Load Balancer Listener** pane displays.
4. In the **Select Type** list box, select **K8s Cluster IP**.
5. In the **Container port** and **External port** fields, enter **80**.
6. In the **Health Check** field, enter **/duplo\_auth**.
7. In the **Backend Protocol** list box, select **TCP**
8. Select **Advanced Kubernetes settings** and **Set HealthCheck annotations for Ingress.**
9. Click **Add**. The Load Balancer listener is added.

<div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FYubrSqkGFBjD8pOeXs5f%2Fnew%20LB%20pic.png?alt=media&amp;token=89092ff1-99a2-4772-bf32-83254b0d219a" alt="" width="332"><figcaption><p>The <strong>Add Load Balancer Listener</strong> pane</p></figcaption></figure></div>

## Step 4: Add an Ingress

1. In the **Tenant** list box, select the **Tools** Tenant.
2. Navigate to **Kubernetes** -> **Ingress**.
3. Click **Add**. The **Add Kubernetes Ingress** page displays.
4. In the **Ingress Name** field, enter `kubect-shell`.
5. From the **Ingress Controller** list box, select **gce**.
6. In the **Visibility** list box, select **Public**.
7. In the **DNS Prefix** fiel&#x64;**,** enter the DNS name prefix.
8. In the **Certificate ARN** list box, select the ARN added to the Plan in the **Certificate for Load Balancer and Ingress** step.

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FJj2Od9HA2DlQfxc24HHR%2Fadd%20ingress%20new.png?alt=media&amp;token=28b41a61-797b-4837-92d2-fa5ad8d4caa1" alt=""><figcaption><p>The <strong>Add Kubernetes Ingress</strong> page</p></figcaption></figure>

9. Click **Add Rule**. The **Add Ingress Rule** pane displays.
10. In the **Path** field, enter (**/**)
11. In the **Service Name** list box, select the Service previously created (**kubectl:80**)
12. Click **Add Rule**. A rule directing all traffic to the **kubectl** Service is created.

<div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FwzAO4oY0dSyy2QLYqGzd%2Fingress%20newest.png?alt=media&amp;token=eb45895e-25df-47fa-a2c2-03247c10ebd0" alt="" width="344"><figcaption></figcaption></figure></div>

\
13\. On the **Add Kubernetes Ingress** page, click **Add**. The Ingress is created.

## Step 5: Add the DNS name to System Settings

1. Navigate to **Administrator** -> **Systems Settings**.
2. Select the **System Config** tab, and click **Add**. The **Add Config** pane displays.<br>

   <div align="left"><figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FzZCW2GzLSR4Eu5ONp4xV%2Fshrunk.png?alt=media&amp;token=e9588db4-41fd-4de2-9e0d-c702d7484dde" alt="" width="371"><figcaption><p>The <strong>Add Config</strong> pane</p></figcaption></figure></div>
3. From the **Config Type** list box, select **AppConfig**.
4. From the **Key** list box, select **Other**.
5. In the second **Key** field, enter **DuploShellfqdn**
6. In the **Value** field, paste the Ingress DNS. To find the Ingress DNS, navigate to **Kubernetes** -> **Ingress**, and copy the DNS from the **DNS** column.<br>

   <figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FdDMQmAFJQuKd5e9JdJPp%2Fimage.png?alt=media&amp;token=9d66dafb-e876-4918-aa2e-ccbd0bbe2dde" alt=""><figcaption></figcaption></figure>
7. Click **Submit**. `kubectl` shell access is enabled.


---

# 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/overview-1/prerequisites/tools-tenant/enable-kubectl-shell.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.
