- Set the hostname for each control-plane and worker node using
hostnamectl set-hostname.
- e.g. Use
sudo hostctl set-hostname k8s-controlfor the control-plane node. - Note: Exit and log back in to each for the changes to take effect.
- Update
/etc/hostson each control-plane and worker node with the IP addresses and hostnames given to each node.
- e.g. An entry might look like this:
172.16.0.0 k8s-control, do this for every node on every node. - Note: Use a the Private IP addresses of the nodes, public IPs might change!
Enter the following commands into the master nodes and worker nodes respectivly:
Master:
sudo bash <(curl -s https://raw.githubusercontent.com/Heapax/Kubernetes-Setup/refs/heads/main/new_master_setup.sh)Worker:
sudo bash <(curl -s https://raw.githubusercontent.com/Heapax/Kubernetes-Setup/refs/heads/main/new_worker_setup.sh)Note: This script has been tested on Ubuntu 22.04 - Jammy Jellyfish.