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 <Jingzhao.Ni@arm.com>
Change-Id: I088392e416bf4ef92be78196a83987279d29e268
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}"