Accessing a Cluster Using CloudShell
CloudShell is a web-based shell tool that simplifies the management and maintenance of cloud resources. It offers an instant, pre-configured environment, allowing you to manage clusters without needing to install, configure, or maintain kubectl locally. This section uses a CCE standard cluster as an example to describe how to access a CCE cluster using CloudShell.
Prerequisites
- The security group for the cluster's master nodes, named in the format cluster-name-cce-control-random-number, allows traffic from the 198.19.0.0/16 CIDR block on port 5443. For details, see How Do I Configure an Access Policy for a Cluster?
- The CoreDNS add-on has been installed in the cluster.
Notes and Constraints
- When kubectl is used in CloudShell, permissions are determined by the logged-in user.
- CloudShell does not support an account or sub-project agency.
- When using CloudShell to access a CCE cluster or container, you can open up to 15 instances concurrently.
- The kubectl certificate in CloudShell is valid for one day. You can reset its validity period by accessing CloudShell through the CCE console.
- Using CloudShell to access containers is available only in the following regions: CN North-Beijing1, CN North-Beijing4, CN North-Ulanqab1, CN East-Shanghai1, CN East-Shanghai2, CN South-Guangzhou, CN Southwest-Guiyang1, and AP-Singapore. For details, see the console.
Procedure
kubectl is pre-installed and configured in CloudShell, and connects to the target cluster by default. You can manage cluster resources by running kubectl commands directly from the CloudShell console. The process is as follows:
- Log in to the CCE console. In the navigation pane, choose Clusters.
- In the cluster list on the right, locate the target cluster and click CLI tool on the right to use CloudShell.
Figure 1 CloudShell
- After logging in to CloudShell, run the following command to check whether kubectl in CloudShell has been connected to the target cluster:
kubectl cluster-info # Check the cluster information.
If the following information is displayed, kubectl in CloudShell has been connected to the cluster. You can then run kubectl commands to manage cluster resources.
Kubernetes control plane is running at https://xx.xx.xx.xx:5443 CoreDNS is running at https://xx.xx.xx.xx:5443/api/v1/namespaces/kube-system/services/coredns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot