All Products
Search
Document Center

Container Compute Service:Manage Kubernetes clusters with kubectl on CloudShell

Last Updated:Mar 26, 2026

Cloud Shell is a browser-based command-line tool that assigns a Linux virtual machine to users at no cost, pre-installed with a variety of tools, environments, and the Web IDE provided by Cloud Shell. When you open Cloud Shell from the Container Compute Service (ACS) console, it automatically loads the kubeconfig file for the selected cluster. kubectl is available without any additional setup.

Prerequisites

Before you begin, ensure that you have:

Open Cloud Shell and connect to the cluster

  1. Log on to the ACS console. In the left navigation pane, click Clusters.

  2. On the Clusters page, find the target cluster. In the Actions column, choose More > Open Cloud Shell. Cloud Shell opens in your browser with kubectl already configured for the cluster.

  3. (Optional) To persist files across sessions, click cloudshell.png and then click Mount File Storage. By default, Cloud Shell runs as an ephemeral session: all files are deleted when the session ends. Mounting a NAS file system keeps your scripts and files available in future sessions. Select Create And Attach or Do Not Create For Now based on your needs.

  4. Run the following command to verify that kubectl can reach the cluster:

    kubectl get namespace

    Expected output:

    NAME              STATUS   AGE
    default           Active   3h14m
    kube-node-lease   Active   3h14m
    kube-public       Active   3h14m
    kube-system       Active   3h14m

    All four namespaces in Active status confirm that kubectl is connected to the cluster.

What's next