Accessing a Container

Scenario

Upon the access, CloudShell is started, kubectl is initialized, and the kubectl exec command is automatically executed.

Notes and Constraints

CloudShell is implemented based on VPCEP. To use kubectl to access a cluster, you need to configure the security group (Cluster name-cce-control-Random number) on the master node of the cluster to allow the following CIDR blocks to access port 5443. By default, port 5443 allows access from all CIDR blocks. If you have hardened security groups and any cluster cannot be accessed in CloudShell, check whether port 5443 allows access from the following CIDR blocks:

  • 198.19.128.0/20
  • 198.19.160.0/20
  • 198.19.176.0 /20

Accessing a Container

You can find the access entry in the workload pod list, as shown in the following figure.

Figure 1 Accessing a container

After you click Remote Login, the following dialog box is displayed. Select the container you want to access and the command, and click OK.

The CloudShell interface is displayed, as shown in the following figure. kubectl is then initialized and the kubectl exec command is automatically executed.

Wait for 5 to 10 seconds until the kubectl exec command is automatically executed.

Exiting (Logging Out from) a Container

You are advised to click the close button in the upper right corner when logging out. Otherwise, the CloudShell interface closed last time will be displayed when you log in to CloudShell next time.

Figure 2 Exiting a container