You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ for node in $(oc get nodes -l node-role.kubernetes.io/worker -o jsonpath='{.items[*].metadata.name}'); do echo ${node} ; oc adm drain ${node}--delete-emptydir-data --ignore-daemonsets=true --timeout=15s --force ; done
66
66
----
67
67
68
-
. Shut down all of the nodes in the cluster. You can do this from your cloud provider’s web console, or by running the following loop:
68
+
. Shut down all of the nodes in the cluster. You can do this from the web console for your cloud provider web console, or by running the following loop. Shutting down the nodes by using one of these methods allows pods to terminate gracefully, which reduces the chance for data corruption.
69
+
+
70
+
[NOTE]
71
+
====
72
+
Ensure that the control plane node with the API VIP assigned is the last node processed in the loop. Otherwise, the shutdown command fails.
73
+
====
69
74
+
70
75
[source,terminal]
71
76
----
72
-
$ for node in $(oc get nodes -o jsonpath='{.items[*].metadata.name}'); do oc debug node/${node}-- chroot /host shutdown -h 1; done
77
+
$ for node in $(oc get nodes -o jsonpath='{.items[*].metadata.name}'); do oc debug node/${node} -- chroot /host shutdown -h 1; done <1>
73
78
----
74
79
+
80
+
<1> `-h 1` indicates how long, in minutes, this process lasts before the control plane nodes are shut down. For large-scale clusters with 10 nodes or more, set to `-h 10` or longer to make sure all the compute nodes have time to shut down first.
81
+
+
75
82
.Example output
76
83
[source,terminal]
77
84
----
@@ -84,18 +91,6 @@ To use host binaries, run `chroot /host`
84
91
Shutdown scheduled for Mon 2021-09-13 09:36:29 UTC, use 'shutdown -c' to cancel.
85
92
----
86
93
+
87
-
Shutting down the nodes using one of these methods allows pods to terminate gracefully, which reduces the chance for data corruption.
88
-
+
89
-
[NOTE]
90
-
====
91
-
Adjust the shut down time to be longer for large-scale clusters:
92
-
93
-
[source,terminal]
94
-
----
95
-
$ for node in $(oc get nodes -o jsonpath='{.items[*].metadata.name}'); do oc debug node/${node} -- chroot /host shutdown -h 10; done
96
-
----
97
-
====
98
-
+
99
94
[NOTE]
100
95
====
101
96
It is not necessary to drain control plane nodes of the standard pods that ship with {product-title} prior to shutdown.
@@ -107,4 +102,4 @@ Cluster administrators are responsible for ensuring a clean restart of their own
107
102
[IMPORTANT]
108
103
====
109
104
If you deployed your cluster on a cloud-provider platform, do not shut down, suspend, or delete the associated cloud resources. If you delete the cloud resources of a suspended virtual machine, {product-title} might not restore successfully.
0 commit comments