Lab 16 - Node operations
Lab 16 - Node operations
InfodiscoveryGoal: take a node out for maintenance and put it back, safely. Chapter: Nodes
Everything here is taints underneath - see Lab 13 if you want to see the same effects expressed by hand.
# setup - something to move around
kubectl create deploy filler --image nginx:1.27 --replicas 6
kubectl get pods -o wide | sort -k7
Task 1. Stop new Pods from being scheduled on worker03, without disturbing
anything already running there. Expected: kubectl get nodes shows
Ready,SchedulingDisabled for worker03, and the Pods on it are untouched.
Task 2. Prove the cordon works: scale the Deployment to 9 and show that no new Pod landed on worker03.
Task 3. Now actually empty worker03 so it can be rebooted. Expected: no workload Pods left on it, all of them running elsewhere.
Task 4. Explain why the command needed --ignore-daemonsets. Show which
Pods it refers to.
Task 5. Bring worker03 back into service and get the workload spread across
all three workers again. Expected: after your commands, kubectl get pods -o wide
shows Pods on worker03.
Task 6. Create a Pod that is not managed by any controller, pinned to worker03, then try to drain the node again. Expected: drain refuses, and tells you why.
Task 7. Find out how much CPU and memory is currently requested on worker01, and how that compares with actual usage.
Clean up
kubectl delete deploy filler
kubectl get nodes # all Ready, none SchedulingDisabled
kubectl delete node worker03 removes only the API object. The kubelet keeps
running and re-registers. A real removal is drain -> delete node ->
kubeadm reset on the machine.