Skip to content

Commit fc12891

Browse files
Merge pull request #28041 from sjhala-ccs/cnv-5260
CNV-5260 Modified node maintenance procedure for CLI
2 parents b4b8e25 + 6603b27 commit fc12891

File tree

2 files changed

+14
-52
lines changed

2 files changed

+14
-52
lines changed

modules/virt-resuming-node-maintenance-cli.adoc

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,13 @@
55
[id="virt-resuming-node-maintenance-cli_{context}"]
66
= Resuming a node from maintenance mode in the CLI
77

8-
Resume a node from maintenance mode and make it schedulable again by deleting
9-
the `NodeMaintenance` object for the node.
8+
Resume a node from maintenance mode by making it schedulable again.
109

1110
.Procedure
1211

13-
. Find the `NodeMaintenance` object:
12+
* Mark the node as schedulable. You can then resume scheduling new workloads on the node.
1413
+
1514
[source,terminal]
1615
----
17-
$ oc get nodemaintenance
18-
----
19-
20-
. Optional: Insepct the `NodeMaintenance` object to ensure it is associated with the correct node:
21-
+
22-
[source,terminal]
23-
----
24-
$ oc describe nodemaintenance <node02-maintenance>
25-
----
26-
+
27-
.Example output
28-
[source,yaml]
29-
----
30-
Name: node02-maintenance
31-
Namespace:
32-
Labels:
33-
Annotations:
34-
API Version: nodemaintenance.kubevirt.io/v1beta1
35-
Kind: NodeMaintenance
36-
...
37-
Spec:
38-
Node Name: node02
39-
Reason: Replacing node02
40-
----
41-
42-
. Delete the `NodeMaintenance` object:
43-
+
44-
[source,terminal]
45-
----
46-
$ oc delete nodemaintenance <node02-maintenance>
16+
$ oc adm uncordon <node1>
4717
----

modules/virt-setting-node-maintenance-cli.adoc

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,26 @@
55
[id="virt-setting-node-maintenance-cli_{context}"]
66
= Setting a node to maintenance mode in the CLI
77

8-
Set a node to maintenance mode by creating a `NodeMaintenance` custom resource
9-
(CR) object that references the node name and the reason for setting it to
10-
maintenance mode.
8+
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.
119

1210
.Procedure
1311

14-
. Create the node maintenance CR configuration. This example uses a CR that is
15-
called `node02-maintenance.yaml`:
12+
. Mark the node as unschedulable. The node status changes to `NotReady,SchedulingDisabled`.
1613
+
17-
[source,yaml]
14+
[source,terminal]
1815
----
19-
apiVersion: nodemaintenance.kubevirt.io/v1beta1
20-
kind: NodeMaintenance
21-
metadata:
22-
name: node02-maintenance
23-
spec:
24-
nodeName: node02
25-
reason: "Replacing node02"
16+
$ oc adm cordon <node1>
2617
----
2718

28-
. Create the `NodeMaintenance` object in the cluster:
19+
. Drain the node in preparation for maintenance. The node live migrates virtual machine instances that have the `LiveMigratable` condition set to `True` and the `spec:evictionStrategy` field set to `LiveMigrate`. All other pods and virtual machines on the node are deleted and recreated on another node.
2920
+
3021
[source,terminal]
3122
----
32-
$ oc apply -f <node02-maintenance.yaml>
23+
$ oc adm drain <node1> --delete-local-data --ignore-daemonsets=true --force
3324
----
3425

35-
The node live migrates virtual machine instances that have the
36-
`LiveMigration` eviction strategy, and taint the node so that it is no longer
37-
schedulable. All other pods and virtual machines on the node are deleted and
38-
recreated on another node.
26+
* The `--delete-local-data` flag removes any virtual machine instances on the node that use `emptyDir` volumes. Data in these volumes is ephemeral and is safe to be deleted after termination.
27+
28+
* The `--ignore-daemonsets=true` flag ensures that daemon sets are ignored and pod eviction can continue successfully.
29+
30+
* The `--force` flag is required to delete pods that are not managed by a replica set or daemon set controller.

0 commit comments

Comments
 (0)