All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term


Connect to a Kubernetes cluster by using kubectl

Last updated:2021-05-11 10:41:36

You can use the Kubernetes command-line tool kubectl to connect to a Kubernetes cluster on Kingsoft Cloud from a local PC.

Install kubectl

For more information about how to install kubectl, see Install Tools.

Obtain the cluster credentials

  1. Log in to the KCE console.
  2. In the left navigation pane, click Cluster.
  3. Click the name of a cluster to go to the cluster management page.
  4. On the Basic Information page, click Get Cluster Config. image20210427195931843.png
  5. In the dialog box that appears, obtain the cluster credentials.

Configure the kubeconfig file

Download the configuration file of the cluster and copy the content of the configuration file to the \$HOME/.kube/config file on the local PC. The $HOME/.kube/config file is the default configuration file used by kubectl.

Connect to the cluster

After the configuration is complete, you can use kubectl to connect to the cluster from the local PC and run cluster management commands. Example:

kubectl get node
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen