Command

Kubernetes Drain a Node Command

The Kubernetes command to drain a node is kubectl drain my-node.

Quick Answer

Command
kubectl drain my-node
KubernetesCommand

Drain a Node

Type this command
kubectl drain my-node

Prepares a node for maintenance by evicting its pods.

Learn More

How to drain a node in Kubernetes

  1. Open the terminal or command interface for Kubernetes.
  2. Type kubectl drain my-node, replace any placeholders, and run it.

Kubernetes Drain a Node Command

Run kubectl drain my-node.

Related Commands

Frequently asked questions

What is the Kubernetes command to drain a node?

Run kubectl drain my-node.

Where do I type this Kubernetes command?

Type it in the terminal or command-line interface used by Kubernetes.

Does this Kubernetes command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify