From: Pedro Escaleira Date: Mon, 4 Mar 2024 17:07:11 +0000 (+0000) Subject: Fix Bug 2338: updated kubernetes apt repo from apt.kubernetes.io to pkgs.k8s.io X-Git-Tag: v15.0.1~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=44403b700ca69defdf289d10d185f8b8aab858d3;p=osm%2Fdevops.git Fix Bug 2338: updated kubernetes apt repo from apt.kubernetes.io to pkgs.k8s.io Change-Id: I530d0098afcc8c2180d454b0d84d34eb9ae82a1d Signed-off-by: Pedro Escaleira --- diff --git a/installers/install_kubeadm_cluster.sh b/installers/install_kubeadm_cluster.sh index 6855d9f4..793e7da7 100755 --- a/installers/install_kubeadm_cluster.sh +++ b/installers/install_kubeadm_cluster.sh @@ -15,7 +15,8 @@ set +eux -K8S_VERSION=1.26.5-00 +K8S_VERSION=1.26 +K8S_PACKAGE_VERSION="$K8S_VERSION".5-1.1 # installs kubernetes packages function install_kube() { @@ -24,12 +25,11 @@ function install_kube() { # 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 -y update && sudo apt-get install -y apt-transport-https ca-certificates curl - sudo install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg - echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list + 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} + sudo apt-get install -y kubelet=${K8S_PACKAGE_VERSION} kubeadm=${K8S_PACKAGE_VERSION} kubectl=${K8S_PACKAGE_VERSION} sudo apt-mark hold kubelet kubeadm kubectl [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function }