From 637ecee18f3549a7ad7487dee116fd5360d7f58d Mon Sep 17 00:00:00 2001 From: Jim Conner Date: Thu, 6 Dec 2018 17:57:19 -0800 Subject: [PATCH 1/3] =?UTF-8?q?Added=20band-aid=20to=20pull=20config=20on?= =?UTF-8?q?=20worker=20if=20the=20original=20update=20fails.=E2=80=A6=20(#?= =?UTF-8?q?167)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added band-aid to pull config on worker if the original update fails. Fixed teardown to remove conntrack and made other changes that somehow never got merged -- may have to close other PR. * Made variables in new code local. --- .../centos-7.4/sds/common_functions.template | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/clusterctl/examples/ssh/bootstrap_scripts/centos-7.4/sds/common_functions.template b/clusterctl/examples/ssh/bootstrap_scripts/centos-7.4/sds/common_functions.template index f586d9b9..1d623314 100644 --- a/clusterctl/examples/ssh/bootstrap_scripts/centos-7.4/sds/common_functions.template +++ b/clusterctl/examples/ssh/bootstrap_scripts/centos-7.4/sds/common_functions.template @@ -337,10 +337,35 @@ yum_upgrade_node() { + local max_tries i + + max_tries=60 + i=0 + yum --disablerepo='*' --enablerepo=kubernetes-new -y install kubeadm kubelet kubeadm upgrade node config --kubelet-version $(kubelet --version | cut -d ' ' -f 2) + # sometimes the worker node intermittently fails to pull its config from + # the master. This next expression is a band-aid which tells the worker + # to attempt to pull the config again if it doesn't exist on the file system + + while [[ ! -f /var/lib/kubelet/config.yaml ]]; do + if ! kubeadm alpha phase kubelet config download; then + echo >&2 "Unable to pull config on try $((i + 1))/$max_tries; trying again in 2 seconds..." + sleep 2 + else + break + fi + + if [[ $i -ge $max_tries ]]; then + echo >&2 "Maximal attempts reached at $max_tries attempts. Quitting with failure." + return 1 + fi + + ((i++)) + done + # TODO: kubernetes-new is hardcoded with 1.11.2 yum --disablerepo='*' --enablerepo=kubernetes-new -y install kubectl @@ -423,11 +448,11 @@ fi fi - all_dockers=($(rpm -qa 'docker*')) - yum remove -y kubeadm kubectl kubelet kubernetes-cni "${all_dockers[@]}" + yum remove -y kubeadm kubectl kubelet kubernetes-cni 'docker*' 'nginx*' conntrack RM_RF_DIRS="/etc/cni \ /etc/docker \ + /etc/nginx \ /etc/sysconfig/docker \ /etc/ethertypes \ /etc/kubernetes \ @@ -440,7 +465,6 @@ /var/lib/kubelet" for d in ${RM_RF_DIRS}; do - rm -rf $d/** rm -rf $d done } From f27f123e9a4525e510f6605b1c1332af789fedcd Mon Sep 17 00:00:00 2001 From: Jim Conner Date: Thu, 6 Dec 2018 18:07:06 -0800 Subject: [PATCH 2/3] For now, not going to migrate to coredns. This makes that change. (#175) * For now, not going to migrate to coredns. This makes that change. * Moved parameter position per @dwats request. --- .../bootstrap_scripts/centos-7.4/sds/common_functions.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clusterctl/examples/ssh/bootstrap_scripts/centos-7.4/sds/common_functions.template b/clusterctl/examples/ssh/bootstrap_scripts/centos-7.4/sds/common_functions.template index 1d623314..c9a9e63a 100644 --- a/clusterctl/examples/ssh/bootstrap_scripts/centos-7.4/sds/common_functions.template +++ b/clusterctl/examples/ssh/bootstrap_scripts/centos-7.4/sds/common_functions.template @@ -326,7 +326,7 @@ { yum --disablerepo='*' --enablerepo=kubernetes-new -y install kubeadm - kubeadm upgrade apply $CONTROL_PLANE_VERSION -y + kubeadm upgrade apply $CONTROL_PLANE_VERSION --feature-gates=CoreDNS=false -y yum --disablerepo='*' --enablerepo=kubernetes-new -y install kubelet yum --disablerepo='*' --enablerepo=kubernetes-new -y install kubectl From 172deee4d9a76535cb22ca8a1fc0590d2179fb6f Mon Sep 17 00:00:00 2001 From: jenkins Date: Fri, 7 Dec 2018 02:20:19 +0000 Subject: [PATCH 3/3] JENKINSCISKIP --- .versionfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.versionfile b/.versionfile index 2fbba850..57b43616 100644 --- a/.versionfile +++ b/.versionfile @@ -1 +1 @@ -0.1.43 \ No newline at end of file +0.1.44 \ No newline at end of file