2019-05-17 19:04:55 +02:00
|
|
|
// Module included in the following assemblies:
|
|
|
|
|
//
|
2020-03-25 09:50:11 -04:00
|
|
|
// * virt/node_maintenance/virt-setting-node-maintenance.adoc
|
2019-05-17 19:04:55 +02:00
|
|
|
|
2020-03-25 09:50:11 -04:00
|
|
|
[id="virt-setting-node-maintenance-cli_{context}"]
|
2019-05-17 19:04:55 +02:00
|
|
|
= Setting a node to maintenance mode in the CLI
|
|
|
|
|
|
2020-05-08 15:29:05 -04:00
|
|
|
Set a node to maintenance mode by creating a `NodeMaintenance` Custom Resource
|
|
|
|
|
(CR) object that references the node name and the reason for setting it to
|
|
|
|
|
maintenance mode.
|
2019-05-17 19:04:55 +02:00
|
|
|
|
|
|
|
|
.Procedure
|
|
|
|
|
|
2020-05-08 15:29:05 -04:00
|
|
|
. Create the node maintenance CR configuration. This example uses a CR that is
|
2019-05-17 19:04:55 +02:00
|
|
|
called `node02-maintenance.yaml`:
|
|
|
|
|
+
|
|
|
|
|
[source,yaml]
|
|
|
|
|
----
|
2020-05-08 15:29:05 -04:00
|
|
|
apiVersion: nodemaintenance.kubevirt.io/v1beta1
|
2019-05-17 19:04:55 +02:00
|
|
|
kind: NodeMaintenance
|
|
|
|
|
metadata:
|
|
|
|
|
name: node02-maintenance
|
|
|
|
|
spec:
|
|
|
|
|
nodeName: node02
|
|
|
|
|
reason: "Replacing node02"
|
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
. Create the `NodeMaintenance` object in the cluster:
|
|
|
|
|
+
|
2020-08-11 10:57:58 -04:00
|
|
|
[source,terminal]
|
2019-05-17 19:04:55 +02:00
|
|
|
----
|
|
|
|
|
$ oc apply -f <node02-maintenance.yaml>
|
|
|
|
|
----
|
|
|
|
|
|
2020-05-08 15:29:05 -04:00
|
|
|
The node live migrates virtual machine instances that have the
|
2020-03-13 10:59:04 +02:00
|
|
|
`LiveMigration` eviction strategy, and taint the node so that it is no longer
|
2020-05-08 15:29:05 -04:00
|
|
|
schedulable. All other pods and virtual machines on the node are deleted and
|
2019-05-17 19:04:55 +02:00
|
|
|
recreated on another node.
|