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:

kubectl drain nodename

Comments

No Comments Yet.
Be the first to tell us what you think.
Kubernetes
Kubernetes

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
Kubernetes Certified Administrator (CKA) preparation
Kubernetes Certified Administrator (CKA) preparation

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
25 Kubernetes questions that will help you get certified and become more efficient with K8s
25 Kubernetes questions that will help you get certified and become more efficient with K8s

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself