CKA Cluster Maintenance 2 — Questions and Answers
Question 1: Which command safely evicts all pods from a node before maintenance without permanently removing it from the cluster?
- kubectl delete node <node>
- kubectl drain <node> --ignore-daemonsets (Correct answer)
- kubectl taint node <node> key=value:NoSchedule
- kubectl cordon <node>
Correct answer: kubectl drain <node> --ignore-daemonsets
kubectl drain evicts pods gracefully and cordons the node; --ignore-daemonsets skips DaemonSet-managed pods which cannot be evicted.
Question 2: After completing node maintenance, which command makes the node schedulable again?
- kubectl drain <node> --uncordon
- kubectl delete taint <node>
- kubectl uncordon <node> (Correct answer)
- kubectl label node <node> schedulable=true
Correct answer: kubectl uncordon <node>
kubectl uncordon removes the unschedulable taint set by cordon or drain, allowing pods to be scheduled on the node again.
Question 3: A node has a pod with no replication controller. What happens when you run kubectl drain on that node?
- The pod is evicted automatically
- The drain fails unless --force flag is used (Correct answer)
- The pod is rescheduled on another node
- The drain skips that pod silently
Correct answer: The drain fails unless --force flag is used
kubectl drain refuses to delete pods not managed by a ReplicaSet, Deployment, or Job unless --force is specified, as they cannot be rescheduled.
Question 4: What is the default eviction timeout when draining a node in Kubernetes?
- 30 seconds
- 5 minutes
- infinite (waits forever) (Correct answer)
- 2 minutes
Correct answer: infinite (waits forever)
By default, kubectl drain waits indefinitely for pods to terminate; use --timeout to set a deadline.
Question 5: Which etcd operation should be performed before upgrading the Kubernetes control plane?
- etcd compaction
- etcd snapshot backup (Correct answer)
- etcd defragmentation
- etcd member remove
Correct answer: etcd snapshot backup
Taking an etcd snapshot backup before upgrades ensures you can restore cluster state if the upgrade fails.
Question 6: What does the --pod-eviction-timeout flag control in kube-controller-manager?
- How long to wait before deleting a terminating pod
- Grace period before evicting pods from a NotReady node (Correct answer)
- Time allowed for PodDisruptionBudget violations
- Timeout for kubectl drain operations
Correct answer: Grace period before evicting pods from a NotReady node
pod-eviction-timeout sets how long the controller manager waits before evicting pods from nodes that become NotReady.
Question 7: A cluster is running Kubernetes 1.28. What is the maximum number of minor versions you can skip when upgrading with kubeadm?
- Any number of versions
- One minor version at a time (Correct answer)
- Two minor versions at a time
- Three minor versions at a time
Correct answer: One minor version at a time
Kubernetes and kubeadm support upgrading only one minor version at a time; skipping versions is not supported.
Which command safely evicts all pods from a node before maintenance without permanently removing it from the cluster?