Saltar al contenido principal

Steps to install Kubernetes in Ubuntu 22.04

All the commands, step by step on how to install Docker and Kubernetes in an offline environment. We will need multipass installed.


Click on each of the tabs to complete the whole installation. I have tried to separated each tab depending on the different goals.

Follow the video above for specifics.

# 0 what options do we have?
multipass find
# my 'online VM' Ubuntu 22.04
multipass launch --name pc-online --cpus 2 --mem 2048M --disk 5G jammy
# 1 Create 2 nodes 'flavors': master and worker
multipass launch --name master-k8s --cpus 2 --mem 3G --disk 6G jammy
multipass launch --name worker1-k8s --cpus 2 --mem 3G --disk 6G jammy
#multipass launch --name docker-registry --cpus 2 --mem 2048M --disk 10G

# 2 Check if we have the VMs running and setup your local DNS (to connect easily - I tend to forget IPs :p)
multipass list
primary 172.24.223.205
master-k8s 172.24.216.0
pc-online 172.24.213.201
"192.x.x.x master-k8s" >> C:\Windows\System32\drivers\etc\hosts
# More than one line
@"192.x.x.x master-k8s
192.x.x.x worker1-k8s
"@ | out-file C:\Windows\System32\drivers\etc\hosts -enc ASCII -append
cat C:\Windows\System32\drivers\etc\hosts

# previous command is similar to this in Linux:
cat <<EOF > /etc/hosts
master-k8s 172.24.216.54
worker1-k8s 172.24.222.216
EOF

You did it!

Don't forget to like the video and share if you learned somemthing useful. 🤓

Bonus

You can also dowload the scripts I created based on the lab you just completed above.

References: