From 20cee8c48eb21dba39712b1127a4b25377c4f65a Mon Sep 17 00:00:00 2001 From: Trevor Tao Date: Fri, 17 Apr 2020 14:49:17 +0800 Subject: [PATCH] Upgrade Kubernetes version to 1.15.0 The current k8s version 1.13.0 is too old to use, upgrade to 1.15.0 instead. On the other side, we use the src IP of the interface for default route as the default src IP for Kubernetes master management IP if it's used separately. Signed-off-by: Trevor Tao Change-Id: I04537e38af319e7b37c8d9c15edbece990fae427 --- src/foundation/scripts/config | 4 ++-- src/foundation/scripts/k8s_common.sh | 10 +++++----- src/foundation/scripts/k8s_master.sh | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/foundation/scripts/config b/src/foundation/scripts/config index ebfcf6f..81e0219 100755 --- a/src/foundation/scripts/config +++ b/src/foundation/scripts/config @@ -33,9 +33,9 @@ SVC_CIDR=172.16.1.0/24 #IEC support multiple network solution for Kubernetes: calico,flannel,contivpp,cilium,etc CNI_TYPE=calico #kubernetes-cni version 0.7.5/ 0.6.0 -CNI_VERSION=0.6.0 +CNI_VERSION=0.7.5 #kubernetes version: 1.15.2/ 1.13.0 -KUBE_VERSION=1.13.0 +KUBE_VERSION=1.15.0 # DEV_NAME is an associative array, list network interface device names used by contivpp, # Use IP address of K8S_WORKER_GROUP as key, for example diff --git a/src/foundation/scripts/k8s_common.sh b/src/foundation/scripts/k8s_common.sh index 76092fd..a8c83ce 100755 --- a/src/foundation/scripts/k8s_common.sh +++ b/src/foundation/scripts/k8s_common.sh @@ -9,14 +9,14 @@ fi case ${OS_ID_LIKE:-} in debian) DOCKER_VERSION=18.06.1~ce~3-0~ubuntu - KUBE_VERSION=${1:-1.13.0}-00 - K8S_CNI_VERSION=${2:-0.6.0}-00 + KUBE_VERSION=${1:-1.15.0}-00 + K8S_CNI_VERSION=${2:-0.7.5}-00 KUBELET_CFG=/etc/default/kubelet ;; rhel) DOCKER_VERSION=18.06.1.ce-3.el7 - KUBE_VERSION=${1:-1.13.0}-0 - K8S_CNI_VERSION=${2:-0.6.0}-0 + KUBE_VERSION=${1:-1.15.0}-0 + K8S_CNI_VERSION=${2:-0.7.5}-0 KUBELET_CFG=/etc/sysconfig/kubelet ;; *) @@ -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 + sudo apt install -y software-properties-common apt-transport-https curl python-pip # Install Docker as Prerequisite curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - diff --git a/src/foundation/scripts/k8s_master.sh b/src/foundation/scripts/k8s_master.sh index cdcf8bc..67eecf5 100755 --- a/src/foundation/scripts/k8s_master.sh +++ b/src/foundation/scripts/k8s_master.sh @@ -2,7 +2,9 @@ # shellcheck source=/dev/null # For host setup as Kubernetes master -MGMT_IP=$1 +# Use the src of the default route as the default local IP +DEF_SRC_IP=$(ip route get 8.8.8.8 | awk '{ for (nn=1;nn<=NF;nn++) if ($nn~"src") print $(nn+1) }') +MGMT_IP=${1:-${DEF_SRC_IP}} POD_NETWORK_CIDR=${2:-192.168.0.0/16} SERVICE_CIDR=${3:-172.16.1.0/24} -- 2.16.6