From b16783b1ebe99ad99e291b71409f16fd7b9c6859 Mon Sep 17 00:00:00 2001 From: "Jingzhao.Ni" Date: Fri, 23 Aug 2019 13:04:08 +0800 Subject: [PATCH] Fix the bug of installation failure When using the K8s with 1.13.0 version, it will result deployment failed. It mainly because that parsing the "kubeadm join" command in older version is different from 1.15.2 version. When deploying the K8s with 1.13.0 by scripts, the IP address was consider as token key. Finally, it results in the worker node installation failed. Signed-off-by: Jingzhao.Ni Change-Id: I088392e416bf4ef92be78196a83987279d29e268 --- src/foundation/scripts/startup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/foundation/scripts/startup.sh b/src/foundation/scripts/startup.sh index f9a41e9..123039d 100755 --- a/src/foundation/scripts/startup.sh +++ b/src/foundation/scripts/startup.sh @@ -51,8 +51,11 @@ deploy_k8s () { sshpass -p ${K8S_MASTERPW} ssh -o StrictHostKeyChecking=no ${HOST_USER}@${K8S_MASTER_IP} ${INSTALL_SOFTWARE} sshpass -p ${K8S_MASTERPW} ssh -o StrictHostKeyChecking=no ${HOST_USER}@${K8S_MASTER_IP} ${SETUP_MASTER} | tee ${LOG_FILE} - TOKEN_ID=$(grep "\--token " ./${LOG_FILE} | cut -f5 -d' ') - TOKEN_CA_SH256=$(grep "\--discovery-token-ca-cert-hash " ./${LOG_FILE} |cut -f2 -d':') + TOKEN=$(grep "\--token " ./${LOG_FILE}) + TOKEN_ID=$(echo ${TOKEN#*"token "}|cut -f1 -d' ') + + SH256=$(grep "\--discovery-token-ca-cert-hash " ./${LOG_FILE}) + TOKEN_CA_SH256=${SH256#*"sha256:"} KUBEADM_JOIN_CMD="kubeadm join ${K8S_MASTER_IP}:6443 --token ${TOKEN_ID} --discovery-token-ca-cert-hash sha256:${TOKEN_CA_SH256}" -- 2.16.6