mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 00:48:01 +01:00
32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
//nodes/nodes/eco-node-maintenance-operator.adoc
|
|
|
|
:_content-type: PROCEDURE
|
|
[id="eco-setting-node-maintenance-cli_{context}"]
|
|
= Setting a node to maintenance mode in the CLI
|
|
|
|
Set a node to maintenance mode by marking it as unschedulable and using the `oc adm drain` command to evict or delete pods from the node.
|
|
|
|
.Procedure
|
|
|
|
. Mark the node as unschedulable. The node status changes to `NotReady,SchedulingDisabled`.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc adm cordon <node1>
|
|
----
|
|
|
|
. Drain the node in preparation for maintenance.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc adm drain <node1> --delete-emptydir-data --ignore-daemonsets=true --force
|
|
----
|
|
|
|
* The `--delete-emptydir-data` flag removes any pods on the node that use `emptyDir` volumes. Data in these volumes is ephemeral and is safe to be deleted after termination.
|
|
|
|
* The `--ignore-daemonsets=true` flag ensures that daemon sets are ignored and pod eviction can continue successfully.
|
|
|
|
* The `--force` flag is required to delete pods that are not managed by a replica set or daemon set controller.
|