What is a Liveness Probe?
Checks if the container is running. If it fails; K8s kills and restarts the container.
What is a Readiness Probe?
Checks if the container is ready to serve traffic. If it fails; the Pod is removed from Service endpoints.
What is a Startup Probe?
Disables Liveness/Readiness checks until the container has finished its initial startup.
How do you view logs for a pod named ‘myapp’?
kubectl logs myapp
How do you view logs for a specific container in a multi-container pod?
kubectl logs myapp -c <container-name></container-name>
What command shows why a Pod failed to start?
kubectl describe pod <name></name>
How do you see the CPU/Memory usage of pods?
kubectl top pod
If a Pod status is ‘OOMKilled’; what was the likely cause?
The container tried to use more memory than its ‘limits.memory’ allowed.
What is the difference between ‘initialDelaySeconds’ and ‘startupProbe’?
startupProbe disables liveness/readiness checks until the app is ready; whereas initialDelay is a static wait time.
How do you stream logs from all pods with the label ‘app=frontend’?
kubectl logs -l app=frontend
Which command shows you the Events of a namespace in chronological order?
kubectl get events –sort-by=’.lastTimestamp’
How do you run a shell in a running pod to inspect its filesystem?
kubectl exec -it <pod-name> -- /bin/sh</pod-name>
If a Pod is ‘Pending’; what is the most common reason related to resources?
Insufficient CPU or Memory on available nodes to satisfy the Pod’s ‘requests’.
If kubectl commands are timing out, which master component should you check first?
The Kube-APIServer.
What is the difference between ‘kubectl logs’ and ‘journalctl -u kubelet’?
‘kubectl logs’ is for pod containers; ‘journalctl’ is for the system service (Kubelet) running on the node.”
A node is ‘NotReady’ and the Kubelet is running. What is the next thing to check?
Node disk space, memory pressure, or the CNI (network) plugin status.