Drain a node (evict pods for maintenance)

Kubernetes & Strimzi Administration · 3:24

Listen on 93

Lyrics

[Verse 1]
When your server needs some care and love
Time to take it offline from above
But pods are running, workloads too
Here's the gentle way to see it through

[Chorus]
Kubectl drain, move them all away
Ignore daemon sets, they're here to stay
Delete empty dir data, clean and bright
Drain the node for maintenance night
Kubectl drain, that's the way
Keep your cluster running every day

[Verse 2]
First you tell Kubernetes the plan
Mark the node as unschedulable man
Then eviction notices go out
Pods get time to shut down without doubt

[Chorus]
Kubectl drain, move them all away
Ignore daemon sets, they're here to stay
Delete empty dir data, clean and bright
Drain the node for maintenance night
Kubectl drain, that's the way
Keep your cluster running every day

[Bridge]
System pods will stick around
Daemon sets stay safe and sound
But your apps will migrate free
To other nodes gracefully

[Verse 3]
Type the command with the node name clear
Add those flags so nothing you fear
Ignore daemon sets is what you need
Delete empty dir helps you succeed

[Chorus]
Kubectl drain, move them all away
Ignore daemon sets, they're here to stay
Delete empty dir data, clean and bright
Drain the node for maintenance night
Kubectl drain, that's the way
Keep your cluster running every day

[Outro]
When maintenance is done and through
Uncordon brings it back for you
The node returns to active state
Your cluster's healthy, running great

← List nodes with status | Cordon a node (prevent new scheduling) →