Skip to content

Commit 5d9f491

Browse files
committed
Updated commands to oadm drain NODE
1 parent ab926c2 commit 5d9f491

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

admin_guide/manage_nodes.adoc

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -241,31 +241,49 @@ controller] can be evacuated; the replication controllers create new pods on
241241
other nodes and remove the existing pods from the specified node(s). Bare pods,
242242
meaning those not backed by a replication controller, are unaffected by default.
243243

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

247246
----
248-
$ oc adm manage-node <node1> <node2> \
249-
--evacuate --dry-run [--pod-selector=<pod_selector>]
247+
$ oc adm drain <node1> <node2>
250248
----
251249

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

254254
----
255-
$ oc adm manage-node <node1> <node2> \
256-
--evacuate [--pod-selector=<pod_selector>]
255+
$ oc adm drain <node1> <node2> --force=true
257256
----
258257

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

261262
----
262-
$ oc adm manage-node <node1> <node2> \
263-
--evacuate --force [--pod-selector=<pod_selector>]
263+
$ oc adm drain <node1> <node2> --grace-period=-1
264264
----
265265

266-
Alternatively, instead of specifying specific node names (e.g., `<node1>
267-
<node2>`), you can use the `--selector=<node_selector>` option to evacuate pods
268-
on selected nodes.
266+
You can use `--ignore-daemonsets` and set it to `true` to ignore
267+
daemonset-managed pods:
268+
269+
----
270+
$ oc adm drain <node1> <node2> --ignore-daemonset=true
271+
----
272+
273+
You can use `--timeout` to set the length of time to wait before giving up. A
274+
value of `0` sets an infinite length of time:
275+
276+
----
277+
$ oc adm drain <node1> <node2> --timeout=5s
278+
----
279+
280+
You can use `--delete-local-data` and set it to `true` to continue deletion even
281+
if there are pods using emptyDir (local data that will be deleted when the node
282+
is drained):
283+
284+
----
285+
$ oc adm drain <node1> <node2> --delete-local-data=true
286+
----
269287

270288
[[rebooting-nodes]]
271289
== Rebooting Nodes

0 commit comments

Comments
 (0)