CKA Cluster Maintenance 1 — Questions and Answers
Question 1: What is the purpose of 'kubectl drain' command?
- To safely evict all Pods from a node for maintenance (Correct answer)
- To delete a node permanently
- To add a new node
- To restart all Pods
Correct answer: To safely evict all Pods from a node for maintenance
kubectl drain safely evicts all Pods from a node, cordoning it to prevent new Pod scheduling, allowing maintenance work on the node.
Question 2: What is etcd backup important for?
- It stores all cluster state and configuration data (Correct answer)
- It only stores container images
- It is optional for production
- It backs up application code
Correct answer: It stores all cluster state and configuration data
etcd contains all cluster configuration, state, and secrets. Regular backups are critical because losing etcd data means losing the entire cluster state.
Question 3: How do you upgrade a Kubernetes cluster?
- Upgrade control plane first, then worker nodes one at a time (Correct answer)
- Upgrade all nodes simultaneously
- Only upgrade worker nodes
- Reinstall from scratch
Correct answer: Upgrade control plane first, then worker nodes one at a time
Cluster upgrades follow a specific order: upgrade the control plane components first, then upgrade worker nodes one at a time (rolling upgrade) to maintain availability.
Question 4: What is a node cordon?
- Marking a node as unschedulable so no new Pods are placed on it (Correct answer)
- Removing a node from the cluster
- Restarting a node
- Adding labels to a node
Correct answer: Marking a node as unschedulable so no new Pods are placed on it
Cordoning marks a node as unschedulable. Existing Pods continue running, but no new Pods will be scheduled on the cordoned node.
Question 5: What is the purpose of a Kubernetes health check (probe)?
- To determine if a container is running correctly and ready to serve traffic (Correct answer)
- To check disk space
- To monitor network speed
- To validate YAML syntax
Correct answer: To determine if a container is running correctly and ready to serve traffic
Health probes (liveness, readiness, startup) let Kubernetes know if a container is alive, ready for traffic, or still starting up, enabling automatic recovery.
Question 6: What happens when a liveness probe fails?
- Kubernetes restarts the container (Correct answer)
- The Pod is deleted
- Nothing happens
- The node is removed
Correct answer: Kubernetes restarts the container
When a liveness probe fails, Kubernetes determines the container is unhealthy and restarts it, following the Pod's restart policy.
What is the purpose of 'kubectl drain' command?