Connecting to Your Kubernetes Cluster

This documentation is for Dash Enterprise.
Dash Enterprise is the fastest way to write & deploy Dash apps and
Jupyter notebooks.
10% of the Fortune 500 uses Dash Enterprise to productionize AI and
data science apps. Find out if your company is using Dash Enterprise.

This page applies to Dash Enterprise 5.

When you installed Dash Enterprise, you were able to interact with your Kubernetes cluster from the bootstrap node because kubectl, the official Kubernetes command line tool, was
installed as part of the script that you ran. Now that your bootstrap node is decommissioned, you can install kubectl on your workstation to
continue using the command line to interact with your cluster. This page can help you connect to your cluster using kubectl, even if you were not involved in the Dash Enterprise installation.

You can use kubectl commands to retrieve secrets from your cluster, check the status of resources, view logs, and more.
In addition, connecting to your cluster with kubectl allows you to use Lens,
an open-source tool that offers a graphical user interface for inspecting Kubernetes clusters.

Installing kubectl on your workstation is recommended, but is not the only way to inspect your cluster. You can also consider generating a support bundle
and reaching out to us for help.


Installing kubectl

There are multiple ways to install kubectl. We recommend choosing your preferred method from the official kubectl installation documentation:

Updating Your Kubeconfig

kubectl uses a config file that defines cluster connection information. This file is located in the $HOME/.kube directory by default and is commonly called kubeconfig. In this step, you’ll run
a command that adds cluster credentials to the kubeconfig file so that you can use them when you run kubectl commands. When you use a cluster’s kubeconfig information,
that cluster becomes your kubectl context.

You can now run commands against your Kubernetes cluster from your workstation. Learn about kubectl syntax
or view the full reference documentation.

Warning: Do not run kubectl commands that edit or delete objects in the cluster unless instructed by our customer success team. Making changes to Kubernetes objects could cause discrepancies
between the resources on the cluster and what is displayed in the Dash Enterprise App Manager, among other potential issues.

If you have Lens installed, your cluster is added to the list you can choose from in the Lens Catalog.

Checking Your Current Context

If you work with multiple clusters, check your current context before interacting with a cluster:

kubectl config current-context

Switching Contexts

To list the available contexts in your kubeconfig:

kubectl config get-contexts

The context names are displayed in the NAME column.

To switch to a different context:

kubectl config use-context <context-name>

where <context-name> is the name of the context you want to use.

Refer to the kubectl config reference
for more help switching contexts and managing the contents of your kubeconfig.