This is a simple solution that gets you started quickly and easily with K3S High Availability clusters
This project provides you with a choice of two shell scripts that generates a text file with all the commands you need to run on the First 3 Master servers as well as on your worker node servers
Edit one of two shell scripts provided you want to use with the parameters your your servers and use it to generate all the commands you need to run on your servers in a single text file
- You need 4/5 Linux Servers with Ubuntu 22.04 server installed
- I used two PC's with Mint Linux Workstation and installed Virtual Box on each and added one Ubuntu 22.04 server VM
- You need to setup Static IP addresses for each server
- You need DNS entries for your servers if you don't have facilities to do that DynuDNS will give you 4 DNS entries for free
- You need to setup a free account with DynuDNS : https://www.dynu.com/en-US/ControlPanel/Login
- With DynuDNS you create 4 free Dynamic DNS entries for your servers: https://www.dynu.com/en-US/ControlPanel/DDNS
- Enter the Host name you want "elephant" (I used animals) and Choose a suitable Toplevel name "kozow.com"
CreateDeploymentCommands4Ubuntu.sh (this script has been tested with both Ubuntu and Mint Linux) get it here:
You need to choose which of the above scripts you want to use.
nano CreateDeploymentCommands4Ubuntu.sh
Now paste the content of this file:
Then got to the top of the file and update your server IP addresses you user Id and DNS names for those servers
Then press Ctrl X and then press the Y key and press the enter key
chmod 775 CreateDeploymentCommands4Ubuntu.sh
./CreateDeploymentCommands4Ubuntu.sh > ubuntuServerDeploymentList.txt
ubuntuServerDeploymentList.txt
Now run this command to display this file
cat ubuntuServerDeploymentList.txt
run on the server to get token
cat /var/lib/rancher/k3s/server/node-token
nano CreateDeploymentCommands4Ubuntu.sh
./CreateDeploymentCommands4Ubuntu.sh > ubuntuServerDeploymentList.txt
ubuntuServerDeploymentList.txt
Now run this command to display this file
cat ubuntuServerDeploymentList.txt
We now have a Python Script that works with a YAML file allowing you to configure what is generated
This can produce 3 kinds of Clusters in your K3S server:
- K3S-HA Cluster with multiple Master Nodes and Multiple worker Nodes
- K3S Cluster with one Master Nodes and Multiple worker Nodes
- K3S Minimal Cluster with only a master Node and no Worker Nodes
If you want to clone this please clone it from this project: https://github.com/nic0michael/K3S_Cluster_Maker