liveBook · Manning

Node cordon

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A cordon is a node operation that marks a Kubernetes node unschedulable for new pods while leaving existing pods running.

A node cordon marks a Kubernetes node unschedulable for new pods while leaving existing pods running. Use it before maintenance such as patching, upgrading, or replacing a node. section 5.2.1

Cordon and verify scheduling

Run `kubectl cordon kind-worker`, then verify with `kubectl get no`. The node reports `Ready,SchedulingDisabled`. A new Deployment created with `kubectl create deploy nginx2 --image nginx` remains Pending, while existing pods continue running. section 5.2

Separate cordoning from the rest of the maintenance workflow:

  • Cordon blocks scheduling but does not evict pods already running on the node. section 5.2.1
  • Drain evicts running pods and allows controllers such as ReplicaSets to recreate them elsewhere; use `kubectl drain kind-worker --ignore-daemonsets` when appropriate. section 5.2.1
  • Uncordon the node afterward with `kubectl uncordon kind-worker`, or scheduling remains disabled. section 5.2.1

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains the scheduling effect, existing-pod behavior, verification output, and relationship to draining and uncordoning.
Examples
Uses kind-worker, nginx Deployments, Pending pods, kubectl get no output, and a drain followed by pod relocation.
What it assumes
Assumes a running Kubernetes cluster and basic familiarity with pods, Deployments, taints, and DaemonSets.
What you can do after
Operate/configure node scheduling with kubectl cordon, kubectl get no, kubectl drain, and kubectl uncordon.
How it connects
Connects node cordon with pod scheduling, node draining, ReplicaSets, Deployments, taints, and DaemonSets.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.