You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Connecting to clusters
Connecting to clusters using kubectl
Copy page
Download PDF
Connecting to clusters using kubectl
After you create a cluster, you can connect to it to access and manage cluster resources. VKE allows your local computer to access a Kubernetes cluster through kubectl.​
Background​
kubectl is the native command-line tool provided by Kubernetes. It is used to interact with clusters. You can use kubectl to efficiently perform routine cluster O&M tasks in the terminal, such as resource management, application deployment, status checking, and debugging.​
Based on your network environment plan, you can choose one of the following two methods to connect to clusters using kubectl:​
  • Private network access: The client communicates with the API server of clusters via a private IP address. Data traffic is entirely routed within VPCs and is not routed to the Internet. This provides high security and network stability.​
  • Public network access: The API server of clusters exposes entry points for public traffic. This allows clients to connect to the clusters via the Internet. After connecting to clusters, you also need to perform custom security configuration based on the security measures provided by VKE to ensure secure Internet communication. For details, see Configuring security groups.​
Procedure​
  1. Download and install the latest version of the kubectl tool from the official Kubernetes website to your on-premises computer.​
  1. Log in to the VKE console. In the top navigation bar, select the region where your business is located.​
  1. In the left navigation bar, click Cluster. Find the target cluster and click its name.​
  1. On the Overview page, click the Connection tab to obtain the cluster access credentials.​
tip​
For more operations on cluster access credentials, see the Manage cluster access credentials section in this topic.​
  • ​
    Private access
    Internet
    ​
    On the Private network tab, click Generate KubeConfig to obtain cluster private access credentials. After you use the credentials to connect to the cluster, resources in the same VPC can access the cluster.​
    ​
  1. Copy the cluster access credentials to the local $HOME/.kube/config file generated after you install kubectl.​
warning​
If you do not have the $HOME/.kube/config file, create a file and copy the access credentials into it.​
  1. Run the following command in kubectl to check the status of namespaces in the cluster and verify that the connection is successful.​
  • ​
    kubectl get namespace​
    ​
  • If output similar to the following is returned, kubectl has connected to the cluster successfully.​
  • ​
    NAME STATUS AGE​
    default Active 17h​
    kube-node-lease Active 17h​
    kube-public Active 17h​
    kube-system Active 17h​
    ​
Subsequent operations​
  • After obtaining cluster access credentials, review the security group settings provided by VKE to help secure cluster access. For details, see Configuring security groups.​
Last updated: 2026.07.24 10:53:27