Skip to content

[enterprise-3.5] Updated commands to oc adm drain node #7874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions admin_guide/manage_nodes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -241,31 +241,49 @@ controller] can be evacuated; the replication controllers create new pods on
other nodes and remove the existing pods from the specified node(s). Bare pods,
meaning those not backed by a replication controller, are unaffected by default.

To list pods that will be migrated without actually performing the evacuation,
use the `--dry-run` option:
To evacuate one or more nodes:

----
$ oc adm manage-node <node1> <node2> \
--evacuate --dry-run [--pod-selector=<pod_selector>]
$ oc adm drain <node1> <node2>
----

To actually evacuate all or selected pods on one or more nodes:
You can force deletion of bare pods by using the `--force` option. When set to
`true`, deletion continues even if there are pods not managed by a replication
controller, ReplicaSet, job, daemonset, or StatefulSet:

----
$ oc adm manage-node <node1> <node2> \
--evacuate [--pod-selector=<pod_selector>]
$ oc adm drain <node1> <node2> --force=true
----

You can force deletion of bare pods by using the `--force` option:
You can use `--grace-period` to set a period of time in seconds for each pod to
terminate gracefully. If negative, the default value specified in the pod will
be used:

----
$ oc adm manage-node <node1> <node2> \
--evacuate --force [--pod-selector=<pod_selector>]
$ oc adm drain <node1> <node2> --grace-period=-1
----

Alternatively, instead of specifying specific node names (e.g., `<node1>
<node2>`), you can use the `--selector=<node_selector>` option to evacuate pods
on selected nodes.
You can use `--ignore-daemonsets` and set it to `true` to ignore
daemonset-managed pods:

----
$ oc adm drain <node1> <node2> --ignore-daemonset=true
----

You can use `--timeout` to set the length of time to wait before giving up. A
value of `0` sets an infinite length of time:

----
$ oc adm drain <node1> <node2> --timeout=5s
----

You can use `--delete-local-data` and set it to `true` to continue deletion even
if there are pods using emptyDir (local data that will be deleted when the node
is drained):

----
$ oc adm drain <node1> <node2> --delete-local-data=true
----

[[rebooting-nodes]]
== Rebooting Nodes
Expand Down