What does kubectl drain do?
Experience Level: Junior
Tags: Kubernetes
Answer
Drain marks the node as unschedulable to prevent new pods from arriving. It also evicts the pods from the node.
Drain is executed to drain the node in preparation for maintenance.
To drain the node, run the following command:
Related Kubernetes job interview questions
How can you check what are the taints defined on nodes?
Kubernetes JuniorWhat is a taint in Kubernetes?
Kubernetes JuniorWhat does kubectl uncordon do?
Kubernetes JuniorWhat does kubectl cordon do?
Kubernetes JuniorHow do you find Kubernetes pods that consume the most CPU?
Kubernetes Junior