Make sure you have enough resources in your local laptop/desktop to deploy VMs.
One VM requires at least 2 GB RAM, 2 vCPU, 50 GB HDD
Create 2 VMs and install Ubuntu 20.04.3 on it.
Note: Don't create swap partition during installation.
Make sure the VMs are having internet access by using NAT network adapter. NAT will share host's IP address.
Login as root
sudo su -
Assign static IP to both Primary and Secondary nodes. (Master = Primary and Worker = Secondary)
cat /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
addresses:
- 172.23.32.10/20 # IP address which you want to assign
gateway4: 172.23.32.1
nameservers:
addresses: [127.0.0.53,8.8.8.8]
apt-mark hold will will not update or remove below packages
apt-mark hold kubelet kubeadm kubectl
Note down the VM Primary address. (Below command is only for Primary node)
export PRIMARY_IP=<VM management IP address>
kubeadm init --apiserver-advertise-address=${PRIMARY_IP} --pod-network-cidr=10.100.0.0/16
Create bootstrap token on the Primary server. This command is use to join seconadary node to Primary node in a cluster. (Below command is only for Secondary nodes)
Top comments (0)