Interview Prep/Kubernetes/Nodes, kubelet and container runtime

You SSH into a node to debug and need container logs and state without kubectl. What do you use?

BeginnerTroubleshootingNodes, kubelet and container runtime
Answer

Likely causes → API server is unreachable, or you are debugging the kubelet or a control-plane static Pod.

Diagnose →

sudo crictl pods --name web                 # Pod sandboxes
sudo crictl ps -a | grep web                # containers, including exited
sudo crictl logs --tail 100 <container-id>
sudo crictl inspect <container-id> | jq '.status.reason, .status.exitCode'
sudo journalctl -u kubelet -f
ls /var/log/pods/                           # raw log files: <ns>_<pod>_<uid>/<container>/

Fix → Use what you find to fix the root cause. crictl needs /etc/crictl.yaml with runtime-endpoint: unix:///run/containerd/containerd.sock.

Prevent → Make SSM/SSH or kubectl debug node/... access part of the on-call setup before you need it.

All Kubernetes questions

More on Nodes, kubelet and container runtime