Enhance/fix k8s install for Ubuntu 38/4938/1
authortrevor tao <trevor.tao@arm.com>
Mon, 11 Jul 2022 13:26:11 +0000 (21:26 +0800)
committertrevor tao <trevor.tao@arm.com>
Mon, 11 Jul 2022 13:26:11 +0000 (21:26 +0800)
1. Rename the apt package from python-pip to python3-pip
2. Remove the old K8s components before apt install:
kubeadm, kubelet, kubectl, kubernetes-cni

Signed-off-by: trevor tao <trevor.tao@arm.com>
Change-Id: I309f12f410cb705d71208adb09db4cfc6a406be2

src/foundation/scripts/k8s_common.sh

index 5331c12..4002ca8 100755 (executable)
@@ -31,7 +31,7 @@ debian)
   # Install basic software
   echo "Acquire::ForceIPv4 \"true\";" | sudo tee -a /etc/apt/apt.conf.d/99force-ipv4 > /dev/null
   sudo apt update
-  sudo apt install -y software-properties-common apt-transport-https curl python-pip
+  sudo apt install -y software-properties-common apt-transport-https curl python3-pip
 
   # Install Docker as Prerequisite
   curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@@ -66,6 +66,7 @@ debian)
   cat <<-EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
 deb https://apt.kubernetes.io/ kubernetes-xenial main
 EOF
+  sudo apt remove -f kubeadm kubectl kubernetes-cni kubelet
   sudo apt update
   # Minor fix for broken kubernetes-cni dependency in upstream xenial repo
   sudo apt install -y \