Adding Servers
- Create a new server that meets the system requirements
- On your existing server run the following command:
unbind add-nodeThis will output a command that looks like:
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.33.1+k3s1 K3S_URL=https://<YOUR_SERVER_IP>:6443 K3S_TOKEN=<SECRET_JOIN_TOKEN> sh -- Copy the command and run it on the new server.
Verifying the Node joined.
Run the following command on your primary server to check if the node joined successfully:
kubectl get nodesRemoving a node
If you are using longhorn, removing a node will delete all data from the node, including any persistent volumes. To avoid data loss, longhorn must be configured with at least 3 replicas - or you must migrate all data to another node before removing the node.
- Cordon the node you intend to remove, this will prevent new workloads from being scheduled to it.
kubectl cordon <node-name>- Drain the node, this will gracefully move all workloads to other nodes.
kubectl drain <node-name> --ignore-daemonsets --delete-local-data- Delete the node.
kubectl delete node <node-name>- Verify the node is removed.
kubectl get nodesYou are free to repurpose or delete the server as you see fit.
(Advanced) High Availability
This section is a work in progress and just gives a general overview of how to achieve high availability. In the future we will provide more documentation about deploying high-availability version of Unbind
For a high availability k3s cluster, generally you will need to configure the following:
- An odd number of control plane servers (at least 3).
- Control planes need to use
etcd, for k3s this is a matter of adding--cluster-initto/etc/systemd/system/k3s.serviceand restarting the service withsudo systemctl daemon-reload && sudo systemctl restart k3s - It’s ideal to configure an external load balancer, many cloud providers offer load balancers as a service.
- It’s ideal to not schedule normal workloads on the control plane servers, and instead use a separate set of servers for that.
- You can use taints to prevent workloads from being scheduled to the control plane servers.
- If using longhorn (Unbind’s default storage class) - it’s ideal to increase the number of replicas to 3 or more to prevent data loss in the event of a total system failure.
The easiest way to achieve a higher availability setup would be to use a managed Kubernetes solution such as EKS (AWS), GKE (Google), AKS (Azure), or DOKS (DigitalOcean).
An easier, much more cost-effective HA cloud solution is to deploy on Hetzner with the k3s terraform template