#!/bin/bash # kubeadm installation instructions as on # https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ # this script supports Ubuntu 20.04 LTS and later only # run this script with sudo if ! [ -f /tmp/container.txt ] then echo run ./setup-container.sh before running this script exit 4 fi # setting MYOS variable MYOS=$(hostnamectl | awk '/Operating/ { print $3 }') OSVERSION=$(hostnamectl | awk '/Operating/ { print $4 }') # detecting latest Kubernetes version KUBEVERSION=$(curl -s https://api.github.com/repos/kubernetes/kubernetes/releases/latest | jq -r '.tag_name') KUBEVERSION=${KUBEVERSION%.*} # setting previous version VERSION=${KUBEVERSION#*.} PREVIOUSVERSION=$(( VERSION - 1 )) PREVIOUSVERSION=v1.${PREVIOUSVERSION} if [ $MYOS = "Ubuntu" ] then echo RUNNING UBUNTU CONFIG cat <