2022-03-03 11:44:45 +00:00
|
|
|
= Graceful Shutdown of an Openshift 4 Cluster
|
2021-09-24 15:07:45 +09:00
|
|
|
This SOP should be followed in the following scenarios:
|
|
|
|
|
|
|
|
- Graceful full shut down of the Openshift 4 cluster is required.
|
|
|
|
|
2022-03-03 11:44:45 +00:00
|
|
|
== Steps
|
2021-09-24 15:07:45 +09:00
|
|
|
|
|
|
|
Prequisite steps:
|
|
|
|
- Follow the SOP for cordoning and draining the nodes.
|
|
|
|
- Follow the SOP for creating an `etcd` backup.
|
|
|
|
|
|
|
|
|
|
|
|
1. Connect to the `os-control01` host associated with this ENV. Become root `sudo su -`.
|
|
|
|
|
|
|
|
2. Get a list of the nodes
|
2022-04-04 22:22:56 +02:00
|
|
|
+
|
2021-09-24 15:07:45 +09:00
|
|
|
----
|
|
|
|
nodes=$(oc get nodes -o name | sed -E "s/node\///")
|
|
|
|
----
|
|
|
|
|
|
|
|
3. Shutdown the nodes from the administration box associated with the cluster `ENV` eg production/staging.
|
2022-04-04 22:22:56 +02:00
|
|
|
+
|
2021-09-24 15:07:45 +09:00
|
|
|
----
|
|
|
|
for node in ${nodes[@]}; do ssh -i /root/ocp4/ocp-<ENV>/ssh/id_rsa core@$node sudo shutdown -h now; done
|
|
|
|
----
|
|
|
|
|
|
|
|
|
2022-03-03 11:44:45 +00:00
|
|
|
=== Resources
|
2021-09-24 15:07:45 +09:00
|
|
|
|
|
|
|
- [1] https://docs.openshift.com/container-platform/4.5/backup_and_restore/graceful-cluster-shutdown.html[Graceful Cluster Shutdown]
|