#! /bin/bash # Variable Declaration KUBERNETES_VERSION="1.23.3-00" # disable swap sudo swapoff -a # keeps the swaf off during reboot sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab #Letting iptables see bridged traffic lsmod | grep br_netfilter sudo modprobe br_netfilter cat < /dev/null #Install Docker Engine sudo apt-get update -y sudo apt-get install -y docker-ce docker-ce-cli containerd.io #Configure containerd sudo mkdir -p /etc/containerd containerd config default | sudo tee /etc/containerd/config.toml #restart containerd sudo systemctl restart containerd echo "ContainerD Runtime Configured Successfully" #Installing kubeadm, kubelet and kubectl sudo apt-get update -y sudo apt-get install -y apt-transport-https ca-certificates curl #Google Cloud public signing key sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg #Add Kubernetes apt repository echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list #Update apt package index, install kubelet, kubeadm and kubectl, and pin their version: sudo apt-get update -y sudo apt-get install -y kubelet kubectl kubeadm sudo apt-mark hold kubelet kubeadm kubectl