Other Login Methods
Last updated: 2020-02-24 19:32:29PDF
Log in to the container through the web terminal (recommended)
- Log in to the TKE console and select Clusters In the left sidebar.
- On the Cluster Management page, click Cluster ID (cls-xxx) to enter the cluster details page.
- On the cluster details page, select * * Node Management * *-> * * Node * * in Left sidebar.
- On the Node list page, select the node to which the container belongs, click to go to the Pod Management details page, view the instance list, select the container and log in to the remote terminal, as shown in the following figure.
For FAQs about the remote terminal, please View here .
Remote login is not supported for containers that meet any of the following criteria:
- The namespace is kube-system.
- There is no built-in bash in container Image.
Logging in to Container via the Container's Node
Obtain the IP address of the node where the container resides and the container's ID.
Log in to the node. For more information, see Logging in to CVM.
docker pscommand to view the container you want to log into.
[root@VM_88_88_centos ~]# docker ps | grep 75b3b15af61a 75b3b15af61a nginx:latest "nginx -g 'daemon off" About a minute ago Up About a minute k8s_worid.e8b44cc_worid-24bn2_default_81a59654-aa14-11e6-8a18-52540093c40b_42c0b746
docker execcommand to log into the container.
[root@VM_0_60_centos ~]# docker ps | grep 75b3b15af61a 75b3b15af61a nginx:latest "nginx -g 'daemon off" 2 minutes ago Up 2 minutes k8s_worid.e8b44cc_worid-24bn2_default_81a59654-aa14-11e6-8a18-52540093c40b_6b389dd2 [root@VM_0_60_centos ~]# docker exec -it 75b3b15af61a /bin/bash root@worid-24bn2:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
The container has installed the SSH server. Log in to the container through SSH
Obtain the IP address of the container.
Log in to any node in the cluster. For more information, see Logging in to CVM.
Log in to the container via SSH.