Kubernetes
Medium
Commands
Which command would you use to drain a node for maintenance?
Select your answer:
Show answer and explanation
Answer: kubectl drain <node-name>
Explanation
The 'kubectl drain <node-name>' command safely evicts all pods from a node before you perform maintenance on it. It marks the node as unschedulable to prevent new pods from being scheduled to it, and then evicts the pods to other nodes.
More medium Kubernetes questions
- What is the purpose of the 'kubectl rollout' command?
- What is a Kubernetes Endpoint?
- Which command would you use to label a node?
- Which HTTP status code does the Kubernetes Eviction API return when a PodDisruptionBudget blocks an eviction?
- Which component of the Kubernetes control plane is responsible for maintaining the desired state of the cluster?
- What is the difference between a Deployment and a StatefulSet?