#!/bin/bash # kubeadm installation instructions as on # https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ # this script supports Ubuntu 20.04 and later only # run this script with sudo if ! [ $USER = root ] then echo run this script with sudo exit 3 fi # setting MYOS variable MYOS=$(hostnamectl | awk '/Operating/ { print $3 }') OSVERSION=$(hostnamectl | awk '/Operating/ { print $4 }') if [ $MYOS = "Ubuntu" ] then echo RUNNING UBUNTU CONFIG cat < /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF sysctl --system sudo crictl config --set \ runtime-endpoint=unix:///run/containerd/containerd.sock echo 'after initializing the control node, follow instructions and use kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml to install the calico plugin (control node only). On the worker nodes, use sudo kubeadm join ... to join'