LinuxCommandLibrary

kubectl-cordon

marks a node as unschedulable

TLDR

Cordon node

$ kubectl cordon [node-name]
copy
Cordon multiple nodes
$ kubectl cordon [node1] [node2]
copy
Cordon with selector
$ kubectl cordon -l [key=value]
copy
Dry run
$ kubectl cordon [node-name] --dry-run=client
copy

SYNOPSIS

kubectl cordon [options] node

DESCRIPTION

kubectl cordon marks one or more Kubernetes nodes as unschedulable by setting the `node.kubernetes.io/unschedulable` taint on the node object. Once cordoned, the scheduler will not place any new pods on the node, but existing pods already running on it continue to operate normally and are not affected.
Cordoning is typically the first step in a node maintenance workflow, followed by `kubectl drain` to gracefully evict the running pods. It is also useful for isolating a node that is exhibiting problems -- such as high resource usage or hardware errors -- while you investigate, without disrupting workloads already running there.
To return a cordoned node to normal scheduling, use `kubectl uncordon`. The cordon state can be verified by checking the node's status with `kubectl get nodes`, where cordoned nodes display a `SchedulingDisabled` status.

PARAMETERS

NODE

Node name to cordon.
-l SELECTOR
Label selector.
--dry-run MODE
Simulate operation.
--help
Display help information.

CAVEATS

Subcommand of kubectl. Use with drain for maintenance. Uncordon to restore.

HISTORY

kubectl cordon provides node scheduling control for Kubernetes cluster maintenance.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community