To connect to a Container Service for Kubernetes (ACK) cluster from your on-premises machine, we recommend that you use the kubectl command-line tool. This topic describes how to use kubectl to connect to an ACK cluster.
- Download the latest kubectl client from the Kubernetes version description page.
- Install and set up a kubectl client.
For more information, see Install and set up kubectl.
- Configure the cluster credentials.
You can view cluster credentials on the details page of a cluster.
- Log on to the ACK console.
- In the left-side navigation pane of the ACK console, click Clusters.
- On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
- Optional:Click the Basic Information tab. In the Cluster Information section, you can view the public and internal IP addresses that are used to connect
to the cluster.
- Click the Connection Information tab and copy the cluster credentials to a local file on your on-premises machine.
You can create a $HOME/.kube/config file and copy the cluster credentials to this file. This is the default file from which kubectl obtains the cluster credentials. You can also create another file, for example,
/tmp/kubeconfig, and copy the cluster credentials to the file. Then, run the export KUBECONFIG=/tmp/kubeconfig command.
- Run the following command to check whether the kubectl client is connected to the
kubectl get namespaceExpected output:
NAME STATUS AGE default Active 3d6h kube-node-lease Active 3d6h kube-public Active 3d6h kube-system Active 3d6h
What to do next
After the preceding operations are complete, you can use kubectl to connect to the ACK cluster from your on-premises machine.