BLOG04a: Node Maintenance
BLOG07: Node Maintenance - Cordon/Drain
1. What is kubectl cordon?
kubectl cordon?Cordon = mark a node unschedulable
Command:
kubectl cordon <node-name>Common use cases:
Visual Summary:
Action
New Pods
Existing Pods
2. What is kubectl drain?
kubectl drain?Drain = evict all pods safely + mark node unschedulable
Command:
What happens under the hood:
Visual:
Action
New Pods
Existing Pods
3. What is the Node Release Process?
The process consists of 6 stages:
Stage 1: Cordon the node
Stage 2: Drain the node
Stage 3: Perform Maintenance
Stage 4: Bring node back online
Stage 5: Uncordon the node
Stage 6: Verify scheduling
Cordon vs Drain – Comparison
CORDON
DRAIN
Additional Information: What happens if a node is deleted from cluster provider (AWS/GCP/VMware)?
1. Pod Eviction Time Depends On the Pod's Termination Grace Period
Example:
2. DaemonSet pods do NOT block drain
3. Pods backed by local-storage (EmptyDir) require flag
4. Pod Disruption Budgets (PDB) can block drain
5. Typical cluster drain timing
Small cluster, simple workloads
Medium workloads (web apps, backing services)
Heavy workloads (Java apps, large caches, ML processes)
Pods with very large grace periods
6. Monitoring eviction behavior
Summary
Factor
Impact
Last updated