This topic describes how to use kubectl on Cloud Shell to manage a Kubernetes cluster after you log on to the console of Alibaba Cloud Container Service for Kubernetes.

Prerequisites

You have created a Kubernetes cluster. For more information, see Create a Kubernetes cluster.

Background information

If you want to use kubectl to manage a Kubernetes cluster of Container Servcie, you can download kubectl to your local host. For more information, see Connect to a Kubernetes cluster by using kubectl. Additionally, you can also start Cloud Shell on the console of Container Service for Kubernetes, and then use kubectl on Cloud Shell to manage a Kubernetes cluster.

Procedure

  1. Log on to the Container Service console.
  2. In the left-side navigation pane under Kubernetes, click Clusters.
  3. In the Action column of the target cluster, choose More > cos.cls.cloudshell.


    Note

    Do the following:

    • On the Authorization page, click OK to obtain a temporary access key that expires within one hour.
    • On the Storage Space page, click Create Now or Skip as needed.
  4. On Cloud Shell, you can use kubectl to manage a Kubernetes cluster of Container Service.
    Note When you start Cloud Shell associated with the Kubernetes cluster, the system loads the kubeconfig file of the cluster onto Cloud Shell. Then you can use kubectl to manage your cluster.