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?
- The kubelet evicts a pod because its node has crossed the memory.available hard eviction threshold. What happens to that pod?
- After running kubeadm certs renew all, openssl still shows the old expiry date on the certificate served on port 6443. What is the most likely reason?