Cloud Shell is a cloud command-line tool from Alibaba Cloud that allows you to manage Alibaba Cloud resources by running commands in any browser. This topic describes how to use Cloud Shell on the Container Service for Kubernetes (ACK) console to manage clusters by using kubectl.
Prerequisites
Cloud Shell connects to clusters only over the internet. Therefore, you must enable public access for the API server of your Kubernetes cluster. For more information, see Control public access to the API server of a Kubernetes cluster.
Background information
Cloud Shell is a web-based command-line tool. When you start Cloud Shell, it automatically provides you with a free Linux virtual machine. This virtual machine comes pre-installed with common tools and development environments, and includes a Web IDE to help you manage your cloud resources. For more information, see What is Cloud Shell?.
When you launch Cloud Shell from the Container Service for Kubernetes (ACK) console, Cloud Shell automatically loads the cluster's kubeconfig file. You can then use kubectl to manage your cluster directly.
Procedure
-
Log on to the ACS console. In the left navigation pane, click Clusters.
On the Cluster page, find your target cluster and choose in the Actions column.
Optional: Click
. In the Mount Storage dialog box, click Mount Storage.NoteMounting a NAS file system lets you persist commonly used scripts and files. Otherwise, your files are deleted when the Cloud Shell session ends. Based on your requirements, click Create and Bind or Do Not Create.
Run the following command to view the namespaces in the current cluster.
kubectl get namespaceThe expected output is similar to the following:
NAME STATUS AGE default Active 3h14m kube-node-lease Active 3h14m kube-public Active 3h14m kube-system Active 3h14m