Fix Bug 2338: updated kubernetes apt repo from apt.kubernetes.io to pkgs.k8s.io 34/14234/3 v14.0.2
authorPedro Escaleira <escaleira@av.it.pt>
Mon, 4 Mar 2024 17:07:11 +0000 (17:07 +0000)
committerescaleira <escaleira@av.it.pt>
Mon, 11 Mar 2024 14:10:36 +0000 (15:10 +0100)
Change-Id: I104c809f1fd15a3a45c60d3b560a3e5c4d52e230
Signed-off-by: Pedro Escaleira <escaleira@av.it.pt>
installers/install_kubeadm_cluster.sh

index 6855d9f..793e7da 100755 (executable)
@@ -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
 }