In the DuploCloud Portal, navigate to Kubernetes -> Containers. Click on the menu icon () in the row of the Infrastructure for which you want to view the shell, and select Container Shell. The bash shell displays.
Set up KubeCtl within the DuploCloud Portal by downloading the token
DuploCloud provides a way to connect directly to the Cluster namespace using the kubectl
token.
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 is running and that the Hosts which support it are running, as well.
In the DuploCloud Portal, navigate to Kubernetes -> Services.
From the KubeCtl list box, select KubeCtl Token. The Token window displays. Copy the contents to your clipboard.
Accessing kubectl on your local computer
You can access kubectl
on a local computer to a Kubernetes cluster with cluster-admin
privileges to download and run kubeconfig
.
You can obtain Just-In-Time (JIT) access to Kubernetes by using duplo-jit
. See the JIT Access documentation for detailed information about:
• Obtaining JIT access, using the UI and CLI.
• Installing duplo-jit
, using various tools.
• Getting credentials for AWS access interactively, or with an API token.
• Accessing the AWS Console.
kubeconfig
In the DuploCloud Portal, navigate to Administrators -> Infrastructure.
In the Name column, select the Infrastructure in which you want to set up kubectl
.
Click the EKS (for AWS) tab, GKE (for GCP) tab, or the AKS (for Azure) tab.
Click Download Kube Config to download the kubeconfig
file.
If you don't have Administrator access, you can use duplo-jit
to access Kubernetes. When you click Download Kube Config, the Access to Kubernetes from your Workstation window displays, which provides you the alternative of installing duplo-jit
to access your Kubernetes cluster without obtaining permanent access keys.
Use these tools to install kubectl
locally.
Run these commands to enable kubectl
to use the downloaded kubeconfig
.
For Linux or macOS:
For Windows:
Accessing kubectl without administrator privileges
If you don't have administrator privileges, use this procedure to access kubeconfig
using the kubectl
token. kubeconfig
is a YAML file that stores cluster authentication information for kubectl. It contains a list of contexts to which kubectl refers when running commands. By default, kubeconfig
is saved in the $HOME/
directory in the Linux operating system.
Before beginning, refer to this article for more information aboutkubeconfig
.
Add the following code to your AWS profile:
kubectl
tokenThe token that you download is for the selected Tenant only. It is intended for use with a non-human DuploCloud service account.
In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.
Select the Service from the Name column.
From the KubeCtl item list, select KubeCtl Token. The KubeCtl Token window displays.
Click Copy to copy the kubectl
commands in the Token window to your clipboard.
From the KubeCtl item list, select KubeCtl Shell to launch the shell instance. Paste the copied commands into the shell and run them.