set +eux
-#installs kubernetes packages
+K8S_VERSION=1.24
+K8S_PACKAGE_VERSION="$K8S_VERSION".17-1.1
+HELM_VERSION="v3.10.3"
+
+# installs kubernetes packages
function install_kube() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- K8S_VERSION=1.23.3-00
# Kubernetes releases can be found here: https://kubernetes.io/releases/
# To check other available versions, run the following command
# curl -s https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-amd64/Packages | grep Version | awk '{print $2}'
- sudo apt-get update && sudo apt-get install -y apt-transport-https
- sudo apt-get update && sudo apt-get install -y apt-transport-https
- curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
- sudo add-apt-repository "deb https://apt.kubernetes.io/ kubernetes-xenial main"
- sudo apt-get update
+ sudo mkdir /etc/apt/keyrings
+ sudo apt-get -y update && sudo apt-get install -y apt-transport-https ca-certificates curl
+ curl -fsSL https://pkgs.k8s.io/core:/stable:/v"$K8S_VERSION"/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:/v'$K8S_VERSION'/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
+ sudo apt-get -y update
echo "Installing Kubernetes Packages ..."
- sudo apt-get install -y kubelet=${K8S_VERSION} kubeadm=${K8S_VERSION} kubectl=${K8S_VERSION}
- cat << EOF | sudo tee -a /etc/default/kubelet
- KUBELET_EXTRA_ARGS="--cgroup-driver=cgroupfs"
-EOF
+ sudo apt-get install -y kubelet=${K8S_PACKAGE_VERSION} kubeadm=${K8S_PACKAGE_VERSION} kubectl=${K8S_PACKAGE_VERSION}
sudo apt-mark hold kubelet kubeadm kubectl
+
+ sudo rm /etc/containerd/config.toml
+ sudo systemctl restart containerd
+
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
#taints K8s master node
function taint_master_node() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- K8S_MASTER=$(kubectl get nodes | awk '$3~/master/'| awk '{print $1}')
+ K8S_MASTER=$(kubectl get nodes | awk '$3~/control-plane/'| awk '{print $1}')
kubectl taint node $K8S_MASTER node-role.kubernetes.io/master:NoSchedule-
+ kubectl taint node $K8S_MASTER node-role.kubernetes.io/control-plane:NoSchedule-
sleep 5
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
#Helm releases can be found here: https://github.com/helm/helm/releases
function install_helm() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
- HELM_VERSION="v3.7.2"
if ! [[ "$(helm version --short 2>/dev/null)" =~ ^v3.* ]]; then
# Helm is not installed. Install helm
echo "Helm3 is not installed, installing ..."