5.5 - Lab 16¶
Objective¶
- Connect to a Node using SSH
Connect to a Node Using SSH¶
-
Using the terminal, set the kubectl context to the tkc-01 cluster.
kubectl config use-context tkc-01-admin@tkc-01 -
List the nodes in the tkc-01 cluster.
kubectl get nodes -o wide -
Copy the IP address of the control plane node.
-
Connect with SSH by using the capv user.
ssh capv@<CONTROL_PLANE_IP_ADDRESS>The SSH connection succeeds without a password because the ~/.ssh/id_rsa.pub public key from the student desktop was added to each Kubernetes node.
-
Change to the root user.
sudo -i -
Navigate to the
logdirectory.cd /var/log/containers -
List the logs.
ls -lThe directory contains logs for the running containers.
-
Navigate to the
kubernetesdirectory.cd /var/log/kubernetes -
List the logs.
ls -lThe directory contains audit logs for Kubernetes API server.
-
Enter
exitto close the root session and enterexitto close the SSH connection.