By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
(For Engineers Who Need to Debug, Optimize, or Certify—Fast)
You’re a DevOps engineer inheriting a Kubernetes cluster that’s slow, unstable, or costing too much. Logs show kube-apiserver timeouts, pods stuck in Pending, and nodes failing health checks. Or worse: you’re prepping for the CKA/CKAD exam, and you know the control plane will be tested—but you’ve only ever deployed apps, not debugged the cluster itself.
kube-apiserver
Pending
This guide is your cheat sheet to:- Debug why pods aren’t scheduling (hint: it’s often the kube-scheduler or kubelet).- Optimize cluster performance by tuning control plane components (e.g., kube-apiserver rate limits).- Secure the cluster by locking down worker node components (e.g., kubelet TLS bootstrapping).- Pass certifications by nailing the "why" behind each component (e.g., "Why does kube-proxy use iptables vs. ipvs?").
kube-scheduler
kubelet
kube-proxy
iptables
ipvs
Real-world scenario:Your team deploys a new microservice, but pods stay in Pending for 10+ minutes. The kubectl describe pod shows:
kubectl describe pod
Warning FailedScheduling 2m default-scheduler 0/3 nodes are available: 3 Insufficient cpu.
Root cause? The kube-scheduler isn’t aware of node resources because the kubelet on worker nodes isn’t reporting metrics correctly. Fixing this requires understanding how the control plane and worker nodes actually communicate.
kubectl apply
kubectl get
kubectl
--max-requests-inflight
--audit-log-path
etcd
NodeSelector
--scheduler-name
scheduling_attempts_total
kube-controller-manager
ReplicaSet
Deployment
Node
Terminating
--concurrent-deployment-syncs
workqueue_depth
--rotate-certificates
kubelet_volume_stats_*
ClusterIP
sync_proxy_rules_duration_seconds
containerd
cri-o
ErrImagePull
imagePullSecrets
Prerequisites:- A Kubernetes cluster (local minikube/kind or cloud-based).- kubectl configured to access the cluster.- ssh access to a worker node (for kubelet debugging).
minikube
kind
ssh
Symptoms:- kubectl get pods shows a pod stuck in Pending.- kubectl describe pod <pod-name> shows: Warning FailedScheduling 1m default-scheduler 0/3 nodes are available: 3 Insufficient cpu.
kubectl get pods
kubectl describe pod <pod-name>
Warning FailedScheduling 1m default-scheduler 0/3 nodes are available: 3 Insufficient cpu.
kubectl top nodes # Requires metrics-server kubectl describe nodes | grep -A 5 "Allocatable"
Expected output:
Allocatable: cpu: 2 memory: 4Gi pods: 110
If Allocatable is low:- The kubelet isn’t reporting correct resources (e.g., --max-pods is too low).- Fix: Edit /var/lib/kubelet/config.yaml on the node and set: yaml maxPods: 110 # Default is 110, but some distros set it lower Then restart kubelet: bash sudo systemctl restart kubelet
Allocatable
--max-pods
/var/lib/kubelet/config.yaml
yaml maxPods: 110 # Default is 110, but some distros set it lower
bash sudo systemctl restart kubelet
kubectl get pods -n kube-system | grep scheduler
kube-scheduler-control-plane 1/1 Running 0 5d
If missing/crashed:- Check logs: bash kubectl logs -n kube-system kube-scheduler-control-plane - Common issue: Misconfigured --leader-elect (multiple schedulers fighting for leadership). Fix: Ensure only one scheduler is running (or set --leader-elect=true).
bash kubectl logs -n kube-system kube-scheduler-control-plane
--leader-elect
--leader-elect=true
SSH into a worker node:
ssh <worker-node-ip>
Check kubelet status:
sudo systemctl status kubelet journalctl -u kubelet -n 50 --no-pager
Common issues:1. Expired certificates: - Error: x509: certificate has expired or is not yet valid - Fix: Rotate certs: bash sudo kubeadm certs renew all sudo systemctl restart kubelet 2. Disk pressure: - Error: DiskPressure in kubectl describe node - Fix: Clean up unused images: bash sudo crictl rmi --prune
x509: certificate has expired or is not yet valid
bash sudo kubeadm certs renew all sudo systemctl restart kubelet
DiskPressure
kubectl describe node
bash sudo crictl rmi --prune
kubectl get pods -n kube-system | grep kube-proxy kubectl logs -n kube-system kube-proxy-<pod-id>
I1010 12:00:00.123456 1 proxier.go:314] "Syncing iptables rules"
If logs show errors:- Issue: iptables rules are corrupted.- Fix: Restart kube-proxy: bash kubectl delete pod -n kube-system kube-proxy-<pod-id> Or switch to ipvs (faster for large clusters): bash kubectl edit cm -n kube-system kube-proxy Add: yaml mode: "ipvs" Then restart kube-proxy.
bash kubectl delete pod -n kube-system kube-proxy-<pod-id>
bash kubectl edit cm -n kube-system kube-proxy
yaml mode: "ipvs"
Deploy a test pod:
kubectl run test-pod --image=nginx --restart=Never kubectl expose pod test-pod --port=80 --name=test-service
Check if kube-proxy is routing traffic:
kubectl run curl --image=curlimages/curl -it --rm -- sh curl test-service
<!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> ...
If it fails:- Issue: kube-proxy isn’t updating iptables/ipvs rules.- Fix: Restart kube-proxy (as above) or check node network policies.
--enable-admission-plugins=NodeRestriction
logrotate
--anonymous-auth=false
PodTopologySpread
requests
limits
--eviction-hard
--max-pods=50
ETCDCTL_API=3 etcdctl snapshot save backup.db
etcd_server_leader_changes_seen_total
--concurrent-deployment-syncs=10
kube_apiserver_request_duration_seconds
kubelet_running_pods
kube_proxy_sync_proxy_rules_duration_seconds
W0101 00:00:00.123456 1 authentication.go:60] "Unable to authenticate the request"
E0101 00:00:00.123456 1 eviction_manager.go:256] "Eviction manager: failed to get summary stats"
kube_node_status_condition{condition="Ready",status="false"}
kube_pod_status_phase{phase="Pending"} > 0
NotReady
x509
kubeadm certs check-expiration
kubectl logs -n kube-system kube-scheduler-<pod>
kubectl edit cm -n kube-system kube-proxy
mode: "ipvs"
etcd_disk_wal_fsync_duration_seconds
panic
CKA/CKAD Question Patterns:1. "Why is my pod stuck in Pending?" - Answer: Check kube-scheduler logs, node resources (kubectl describe node), and kubelet status. - Trap: "The pod has nodeSelector but no matching nodes" (forgetting taints/tolerations).
nodeSelector
etcdctl endpoint status
Trap: "Restart kube-apiserver" (wrong—it’s usually etcd or network issues).
"What’s the difference between iptables and ipvs in kube-proxy?"
rr
lc
Trap: "Use iptables for all clusters" (wrong—ipvs is better for >1000 services).
"How do you rotate kubelet certificates?"
kubeadm certs renew all
systemctl restart kubelet
Challenge:Your cluster has 3 nodes, but pods are only scheduling on 2 of them. The 3rd node shows Ready but has no pods. Debug and fix it.
Ready
Solution:1. Check for taints: bash kubectl describe node <node-name> | grep Taints If you see NoSchedule, remove it: bash kubectl taint nodes <node-name> key:NoSchedule- 2. Check kubelet logs for registration errors: bash journalctl -u kubelet -n 50 --no-pager | grep "failed to register" 3. Verify node resources: bash kubectl describe node <node-name> | grep -A 5 "Allocatable" If Allocatable is 0, check kubelet config (/var/lib/kubelet/config.yaml).
bash kubectl describe node <node-name> | grep Taints
NoSchedule
bash kubectl taint nodes <node-name> key:NoSchedule-
bash journalctl -u kubelet -n 50 --no-pager | grep "failed to register"
bash kubectl describe node <node-name> | grep -A 5 "Allocatable"
0
Why it works:- Taints prevent scheduling unless pods have matching tolerations.- kubelet registration issues (e.g., wrong --node-ip) can make nodes appear Ready but unusable.
--node-ip
--data-dir
/var/lib/etcd
true
false
--proxy-mode
Essential Commands:
# Check control plane health kubectl get pods -n kube-system # Check node status kubectl describe node <node-name> # View kubelet logs journalctl -u kubelet -n 50 --no-pager # Check etcd health ETCDCTL_API=3 etcdctl endpoint status --write-out=table # Restart kube-proxy kubectl delete pod -n kube-system kube-proxy-<pod-id>
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.