Access cluster¶
Clusters accessed or created using the DCE 5.0 Container Management platform can not only be accessed directly through the UI interface, but also can be accessed through two other methods:
- Online access via CloudShell
- Access through kubectl after downloading the cluster certificate
Prerequisites¶
- Ability to access the UI interface of container management, and create or join a cluster in container management.
- The current operating user should have
Cluster Admin
permission or higher.
Access the cluster via CloudShell¶
-
On the
Cluster List
page, select the cluster to be accessed through CloudShell, click the...
operation icon on the right and clickConsole
in the drop-down list. -
Execute the
kubectl get node
command on the CloudShell console to verify the connectivity between CloudShell and the cluster. As shown in the figure, the console will return the node information under the cluster.
You can now access and manage the cluster through CloudShell.
Access via cluster certificates and kubectl¶
If you need to access and manage the cloud cluster through a local node, you need to download the cluster certificate to the local node, and then use the kubectl tool to access the cluster. Before starting, the following conditions need to be met:
- Ensure the network interconnection between local nodes and cloud clusters.
- Make sure the kubectl tool is installed on the local node. For detailed installation methods, please refer to Installing kubectl.
Download cluster certificate¶
-
On the
Cluster List
page, select the cluster that needs to download the certificate, click...
on the right, and clickGet Certificate
in the pop-up menu. -
Select the certificate validity period and click
Download Certificate
.
Access the cluster through kubectl¶
By default, the kubectl tool will look for a file named config
from the $HOME/.kube
directory of the local node. This file stores the access credentials of the relevant cluster, and kubectl can use this configuration file to connect to the cluster.
-
Find and open the downloaded cluster certificate, and copy its content to the
config
file of the local node. -
Execute the following command on the local node to verify the connectivity of the cluster:
The expected output is something like:
You can now access and manage the cluster locally with kubectl.