Add and remove cluster nodes#
Info
To avoid unexpected complications, make sure that you have an MKE 4 cluster up and running before you follow the procedures herein for adding and removing nodes.
Add nodes to an MKE 4 cluster#
-
Append the host information for the new node to the
hostssection of themke4.yamlconfiguration file in the following format:- role: worker ssh: address: <address> keyPath: <key location> port: <ssh port> user: <username> -
Run
mkectl applycommand to add the new node.
Important
When you add or re-add a controller node to an existing
cluster, you must place the host entry for the new controller after the existing
controllers on the host list, then run mkectl apply. Note that the new node
can be placed ahead of any worker entries.
Remove nodes from an MKE 4 cluster#
The method for removing nodes from an MKE 4 cluster differs, depending on whether the node is a control plane node or a worker node.
Remove a control plane node#
Refer to the k0s documentation, Remove or replace a controller for information on how to remove a control plane node from an MKE 4 cluster.
Remove a worker node#
Important
If you are using the eBPF Calico CNI dataplane, you must reset the target node before removing it to avoid an immediate loss of network connectivity. For detail on how to reset a node, refer to the k0s documentation, Reset a k0s node locally.
-
Delete the worker node from the cluster:
kubectl --kubeconfig ~/.mke/mke.kubeconf delete node <worker_node_name> -
Run the following command sequence on the node itself, to uninstall k0s:
sudo k0s stop sudo k0s reset sudo reboot -
Delete the host information for the deleted node from the
hostssection of themke4.yamlconfiguration file, to circumvent any potential mkectl issues. -
Apply the configuration:
mkectl apply -f mke4.yaml