Fix Bug 2338: updated kubernetes apt repo from apt.kubernetes.io to pkgs.k8s.io 32/14232/1
authorPedro Escaleira <escaleira@av.it.pt>
Mon, 4 Mar 2024 17:07:11 +0000 (17:07 +0000)
committerPedro Escaleira <escaleira@av.it.pt>
Mon, 4 Mar 2024 17:07:11 +0000 (17:07 +0000)
Change-Id: I72bb442fb5c69e5dc48e7f8272df912bd56ad9bc
Signed-off-by: Pedro Escaleira <escaleira@av.it.pt>
installers/install_kubeadm_cluster.sh

index fa89a9a..1636adf 100755 (executable)
@@ -15,7 +15,8 @@
 
 set +eux
 
-K8S_VERSION=1.28.2-00
+K8S_VERSION=1.28
+K8S_PACKAGE_VERSION="$K8S_VERSION".2-1.1
 
 # installs kubernetes packages
 function install_kube() {
@@ -24,11 +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
-    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
 }