Protect nodes from automatic restart
Раздел «For cluster administrators»: быстрый переход по подразделам
На этой странице
Shturval automatically restarts nodes when node configuration changes or the cluster is updated. During an automatic restart, the platform performs the following actions:
- Cordon;
- Drain;
- Reboot.
If needed, you can protect cluster nodes from automatic restart using special labels. Use this approach when you must perform operations before draining or rebooting a node.
Follow these steps:
- Block node drain.
- Apply the required changes.
- Verify that the node configuration reports the
reboot requiredcondition. - Allow changes to be applied without drain, overriding the drain block.
- Wait for the node to reboot or for the configuration to be applied.
- Remove the permission to apply changes without drain.
Replace my-special-node with the actual node name in the commands below.
- To block drain on a node, set the
node.shturval.tech/disable-drainlabel:
Command
kubectl label node my-special-node node.shturval.tech/disable-drain=
Screenshot

- To verify that the label is set, run:
Command
kubectl get node my-special-node -o jsonpath='{.metadata.labels}' | jq -r
Screenshot

Please note! Complete the steps required to prepare the node for restart, then drain the node manually. The disable-drain label blocks only automatic drain.
- Allow changes to be applied by setting the
node.shturval.tech/apply-as-islabel. Please note! Theapply-as-islabel applies changes immediately without checking whether the node was drained.
Command
kubectl label node my-special-node node.shturval.tech/apply-as-is=
Screenshot

- Verify that the node configuration (nodeconfig) is applied and reports
ready=true:
Command
kubectl get nodeconfig my-special-node -o jsonpath='{.status.ready}'
Screenshot

- Remove the
node.shturval.tech/apply-as-islabel from the node to disable unconditional application of changes:
Command
kubectl label node my-special-node node.shturval.tech/apply-as-is-
Screenshot

Please note! The node.shturval.tech/disable-drain label remains on the node and continues to block drain.