Patch and restart the nodes
Node maintenance restarts the cluster nodes to apply OS patches, kernel updates, or to recover the whole cluster after a crash. To keep the platform running, restart the nodes one at a time. Keep the self-hosted-controller (SHC) commands RebootNodes and KubeCrashRecovery for a planned cold restart during a maintenance window.
Prerequisites
- You run the commands from the orchestration node, with
kubectlaccess to the cluster. - The platform is healthy before you start: every node is
Readyand the Ceph cluster reports all placement groupsactive+clean. - You can open an SSH session with
sudorights on every node.
Patch the nodes one at a time
The Ceph storage keeps two copies of the data on two different nodes. While one node is down, the data stays available from the other copy. The three manager nodes hold the Kubernetes database (etcd), which stays available as long as two managers are running.
Restart one node at a time
If two nodes holding the same data are down at the same time, the platform can no longer read or write that data. Never restart a node before the previous one is back and the storage has recovered.
-
To prevent Ceph from moving data while a node is down, set the
nooutflag:kubectl exec -n rook-ceph deploy/rook-ceph-tools -- ceph osd set noout -
Repeat the following steps for each node, one node at a time:
- Find the node name in the output of
kubectl get nodes. -
Move the pods of the node to the other nodes:
Do not force the eviction
If the command stops on a pod disruption budget, do not force the eviction.
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data --timeout=10m -
Apply your patches on the node.
- Restart the node, for example with
sudo systemctl reboot. - Wait until
kubectl get nodeslists the node asReadyagain. -
Allow pods to run on the node again:
kubectl uncordon <node-name> -
Wait until the Ceph cluster reports every placement group
active+cleanbefore you move to the next node:Expected Ceph warnings
While
nooutis set, the health status stays atHEALTH_WARNwith the messagenoout flag(s) set. While the node is down and until the storage has recovered, placement groups also reportundersizedordegraded. Both states are expected and clear on their own.kubectl exec -n rook-ceph deploy/rook-ceph-tools -- ceph status
- Find the node name in the output of
-
Once every node is patched, remove the
nooutflag:kubectl exec -n rook-ceph deploy/rook-ceph-tools -- ceph osd unset noout -
To check the platform health, run
exec Diagnostic. See Run platform diagnostics.
Result
Every node runs the patched OS, the Ceph cluster reports HEALTH_OK, and the platform stayed available during the whole procedure.
Run a cold restart of the whole cluster
A cold restart reboots every node, then restarts every pod in dependency order. Use it when the whole cluster must be restarted or after an unexpected crash of several nodes that left pods stuck in a failed state.
Full platform outage
RebootNodes and KubeCrashRecovery make the whole platform unavailable: ingestion, detection, and the web interface stop until every pod is running again. Run them only during a maintenance window. To patch the nodes without an outage, use the rolling procedure instead.
-
To reboot the nodes, run:
exec RebootNodesThe command reboots every node of
utils.ansible.inventoryin parallel, up to five nodes at a time, without draining them. It waits up to five minutes for each node to accept SSH connections again. -
Wait until
kubectl get nodeslists every node asReady.Kubernetes API required
KubeCrashRecoverystops immediately if it cannot reach the Kubernetes API. Do not run it whilekubectl get nodesfails or a node isNotReady. -
To restart the pods in dependency order, run:
exec KubeCrashRecoveryThe command deletes every pod of the cluster, namespace group by namespace group, and waits for each group to be ready before it moves to the next. See KubeCrashRecovery.
-
Check that Vault is unsealed. Vault unseals itself when its pod starts, so the output must show
Sealed false:kubectl exec -n vault vault-0 -- vault statusIf Vault is still sealed, delete the
vault-0pod so that the unsealing runs again. -
Check that the ArangoDB pods of the
supportnamespace are running and ready.KubeCrashRecoverydoes not wait for them:kubectl get pods -n support | grep arango -
To check the platform health, run
exec Diagnostic. See Run platform diagnostics.
Result
Every node is Ready, every pod is running, Vault is unsealed, and the platform accepts events and logins again.
Related links
- Debug your deployment: Reference of the
RebootNodesandKubeCrashRecoverycommands. - Use the SHC interface: The Storage tab shows the Ceph status.
- Run platform diagnostics: Health checks per platform area.