So let’s spin up 3 Ubuntu server 22.04 VMs on our vSphere. I recommend using the Ubuntu cloud image and a VM template. To find out how to create such a VM template follow this post. We are going to need it anyway later so save some time and create it now.
If you do not know how to deploy a VM through a template follow this procedure.
In order to have HA deploy the VMs in different ESXi servers
Now we have 3 servers. Mine are
K3s-CL01-01 on ESXi1 xxx.yyy.zzz.161/24
K3s-CL01-02 on ESXi0 xxx.yyy.zzz.162/24
K3s-CL01-03 on ESXi0 xxx.yyy.zzz.163/24
And the Load Balancer address will be the xxx.yyy.zzz.160/24
Of course xxx.yyy.zzz is your subnet
Right now the nodes have IP address that they got from DHCP. Login into them and change them to static by editing the yaml file like the example bellow
sudo nano /etc/netplan/50-cloud-init.yaml
Then apply the configuration
sudo netplan apply
If you so not want to use the default user (ubuntu) you can add now another one
sudo adduser myadmin
type in a password and the users data and after the user is created add him (or her) to the sudo group
sudo usermod -aG sudo myadmin
By default on the cloud images the ssh password authentication is disabled. So in order to ssh in edit the sshd_config
suso nano /etc/ssh/sshd_config
find the line
PasswordAuthentication no
and change the no to yes
PasswordAuthentication yes
Then restart the ssh service
systemctl restart ssh
Repeat for the rest of the VM servers
*Optional For the Worker nodes, install Ubuntu Server 22.04 . Official documentation for the PIs is here
K3s-CL01-04 xxx.yyy.zzz.164
K3s-CL01-05 xxx.yyy.zzz.165
K3s-CL01-06 xxx.yyy.zzz.166
HomeLab – Deployment of an HA Kubernetes