Install Ubuntu Updates + Apps
$ sudo apt-get update
$ sudo apt-get upgrade -y
$ sudo apt-add-repository -y ppa:cappelikan/ppa
$ sudo add-apt-repository ppa:danielrichter2007/grub-customizer
$ sudo apt-get install -y apt-transport-https ca-certificates curl ssh xauth mainline grub-customizer docker.io build-essential linux-headers-generic xorg x11-apps dkms module-assistant net-tools xrdp
$ sudo m-a prepare
# I am installing required dependencies for kubernetes,x11,docker,kernel for display
$ sudo swapoff -a
$ sudo nano /etc/fstab (comment out swap.img)
Complete Network Config
Your network interface will most likely be enp0s3 or ethX or wlan0 or ensXX (DO NOT CHANGE lo INTERFACE AS IT CAN CAUSE FAILURE OF CONNECTION LOCALHOST APPS TO OTHER PORT APPS)
$ sudo ifconfig NETWORK_INTERFACE YOUR_IP netmask SUBNET_MASK
$ sudo route add default gw DEFAULT_GATEWAY
Install Kernel 6.3 (MANDATORY FOR NETWORK + VM RESIZING - VBox_GAs_6)
# Identify which kernel version is running
$ uname -r
6.5.0-14-generic
$ sudo apt update
# Start | "Mainline Kernels" and install kernel 6.3
# Show grub bootmenu to boot the newly installed kernel
$ sudo gedit /etc/default/grub
#GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT_STYLE=menu
#GRUB_TIMEOUT=0
GRUB_TIMEOUT=5
$ sudo update-grub
$ sudo reboot now
# From the Grub boot menu, select Advanced options for Ubuntu | Ubuntu, with Linux 6.3.0-060300-generic | Enter
# Check running kernel
$ uname -r
6.3.0-060300-generic
# Mount VirtualBox guest additions ISO and reinstall
# Make sure that gcc-12 is installed, otherwise the installation will fail
$ cd /media//media/a/VBox_GAs_6.1.XX/
$ sudo ./VBoxLinuxAdditions.run
$ sudo reboot now
# When problem is solved, change Grub bootmenu permanently
$ grub-customizer
# Tab General Settings | predefined: Advanced options for Ubuntu>Ubuntu, with Linux 6.3.0-060300-generic | Save
# reboot
Install Docker and Kubernetes
$ sudo mkdir /etc/apt/keyrings
$ sudo usermod -aG docker $USER && newgrp docker
$ curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
$ echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install -y kubelet kubeadm kubectl
Kubernetes Setup(Only if using separate servers/machines for running Worker/Master Nodes)
$ sudo kubeadm init
# Here Kubeadm will give you an cluster-joiner key/ token (Copy it)
$ kubectl get nodes(to check node status , dont worry if you see not ready :)
$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
OR
$ kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.0/manifests/calico.yaml
OR
$ kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml
Steps to set up Kubernetes on the worker nodes.
# Paste the cluster-joiner token/key , It should look something like the command below (x's need to be replace with ip given by kubeadm and the token part with the token)
$ kubeadm join xxx.xxx.xxx.xxx --token xxxxxxx \ -discovery-token-ca-cert-hash
Minikube Setup (For Single VM Development)
$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
$ sudo dpkg -i minikube_latest_amd64.deb
$ minikube start
Terraform Install
$ wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
$ echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
$ sudo apt update && sudo apt install terraform
$ terraform --version