Protect nodes from automatic restart
Раздел «Cluster administrator»: быстрый переход по подразделам
На этой странице
Shturval provides a mechanism for automatically restarting nodes in cases of changes in node configuration (NCI) or cluster updates. The drain and reboot policy is set by the shturval-node-config operator. When the node is automatically restarted, the following actions are performed:
- Cordon;
- Drain;
- Reboot.
If necessary, you can protect cluster nodes from automatic restart using special labels. This is applicable for cases when some operations must be performed before draining or rebooting the cluster node.
The sequence of actions will be as follows:
- Set a ban on drain nodes.
- Make the necessary changes.
- Check that the node configuration has received the condition reboot required.
- Set the permission to apply changes without a drain node over the prohibition on drain.
- Wait until the node reboots or the configuration is applied.
- Remove permission to apply changes without drain node.
Commands must be executed using the node name instead of my-special-node.
- To disable the Drain node, set the
node.shturval.tech/disable-drainlabel using the command:
Command — illustration
kubectl label node my-special-node node.shturval.tech/disable-drain=
Screenshot

- To check the installation of the label, run the command:
Command — illustration
kubectl get node my-special-node -o jsonpath='{.metadata.labels}' | jq -r
Screenshot

Please note! Complete the necessary steps to prepare the node for restart. After completing the steps, perform drain. The `disable-drain` label only blocks the node's automatic drain.
- Set the permission to apply the changes using the
node.shturval.tech/apply-as-islabel.
Please note! The `apply-as-is` label allows changes to be applied immediately without checking whether the node has been drained.
Command — illustration
kubectl label node my-special-node node.shturval.tech/apply-as-is=
Screenshot

- Check that the resource NodeConfig of the node (
nodeconfig) is applied and has the statusready=true:
Command — illustration
kubectl get nodeconfig my-special-node -o jsonpath='{.status.ready}'
Screenshot

- Be sure to remove the
node.shturval.tech/apply-as-islabel from the node to disable permission to unconditionally apply changes to the node by running the command:
Command — illustration
kubectl label node my-special-node node.shturval.tech/apply-as-is-
Screenshot

Please note! The ```node.shturval.tech/disable-drain``` label remains installed on your node, blocking the Drain of the node.