Cordon Drain Node OpenShift¶
Introduction¶
Node maintenance in OpenShift uses cordon and drain to move workloads before repair or reboot. Always check DaemonSets, local storage, and PodDisruptionBudgets before draining.
Why This Matters¶
OpenShift administration relies on operators and cluster-scoped resources. A bad change can affect many projects, so inspect status and events before applying fixes.
Practical Examples¶
oc get nodes
oc adm cordon worker-1
oc adm drain worker-1 --ignore-daemonsets --delete-emptydir-data
oc adm uncordon worker-1
Example output:
node/worker-1 cordoned
node/worker-1 drained
node/worker-1 uncordoned
Verification¶
oc get nodes
oc get pods -A --field-selector spec.nodeName=worker-1
oc get pdb -A
Troubleshooting¶
Read the operator message, check the namespace where the component runs, inspect related events, and confirm whether the condition is Available, Progressing, or Degraded.
Common Mistakes¶
- Draining without checking PodDisruptionBudgets.
- Forgetting to uncordon after maintenance.
- Deleting static or mirror pods manually.
Quick Checklist¶
- Confirm the active project.
- Inspect the exact object named in the error.
- Read recent events.
- Apply one focused fix.
- Verify status after the change.
Related Guides¶
Summary¶
Cordon Drain Node OpenShift is an administration task that should be driven by cluster status, operator conditions, and component logs instead of broad restarts.