@@ -241,31 +241,49 @@ controller] can be evacuated; the replication controllers create new pods on
241
241
other nodes and remove the existing pods from the specified node(s). Bare pods,
242
242
meaning those not backed by a replication controller, are unaffected by default.
243
243
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:
246
245
247
246
----
248
- $ oc adm manage-node <node1> <node2> \
249
- --evacuate --dry-run [--pod-selector=<pod_selector>]
247
+ $ oc adm drain <node1> <node2>
250
248
----
251
249
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:
253
253
254
254
----
255
- $ oc adm manage-node <node1> <node2> \
256
- --evacuate [--pod-selector=<pod_selector>]
255
+ $ oc adm drain <node1> <node2> --force=true
257
256
----
258
257
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:
260
261
261
262
----
262
- $ oc adm manage-node <node1> <node2> \
263
- --evacuate --force [--pod-selector=<pod_selector>]
263
+ $ oc adm drain <node1> <node2> --grace-period=-1
264
264
----
265
265
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
+ ----
269
287
270
288
[[rebooting-nodes]]
271
289
== Rebooting Nodes
0 commit comments