Multi-Node Scheduling, Cordon, Drain, and Node Maintenance
Expert · 45 minutes · 5 tasks, checked automatically · 100 points
In this expert-level lab you will explore Kubernetes node management techniques used in real production environments. You will create a multi-node kind cluster, deploy workloads with scheduling constraints using nodeSelector and pod anti-affinity, then simulate node maintenance by cordoning and draining nodes while observing how the scheduler reschedules pods. You will also configure taints and tolerations to control workload placement, and finally restore the node to service. This lab builds foundational skills for zero-downtime cluster maintenance.
What you’ll learn
- Label nodes and deploy workloads using nodeSelector and pod anti-affinity to spread replicas across worker nodes
- Cordon a worker node and verify that new pods are not scheduled onto it, then drain the node safely
- Apply taints and tolerations to control which workloads can run on specific nodes, then uncordon the node to restore it to service
How this lab works
- Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Cluster: A real Kubernetes cluster on your computer (kind)
- Kubernetes: 1.34.8
- Nodes: 3
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- A kind cluster created in the Kubernetes Playground with at least 3 nodes (1 control-plane + 2 workers)
Topics: kubernetes, scheduling, node-maintenance, cordon, drain, taints, tolerations, pod-anti-affinity, nodeSelector, PodDisruptionBudget
Create a free account to start this lab.
Keep going
- Cluster API with Docker Provider: Declarative Workload Cluster Lifecycle
- Multi-Cluster Federation with Karmada and vcluster
- Run a DaemonSet Across All Nodes
- Zero-Downtime Rolling Updates with maxSurge / maxUnavailable
- Static Pods Managed Directly by the Kubelet
- IndexedJob and Parallel Job Completions in Kubernetes