Added overwrite flag in script 31 and 35

This is a needed workaround for host config generator from some recent
changes. Only add the workaround to 2.0 branch for the GA release.
The actual fix should go to v2 branch.

Signed-off-by: James Gu <james.gu@att.com>
Change-Id: Ied0d8712fd154e8e7c979a551417a6429c148456
This commit is contained in:
James Gu 2021-04-14 14:08:38 -07:00 committed by Drew Walters
parent ad5fabe0d6
commit 404b32ef87
1 changed files with 23 additions and 1 deletions

View File

@ -23,6 +23,28 @@ export WORKER_NODE=${WORKER_NODE:-"$(airshipctl phase render workers-target \
yq .metadata.name | \
sed 's/"//g')"}
# Annotate node for hostconfig-operator
hosts=(`kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s get nodes -o name`)
for i in "${!hosts[@]}"
do
kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s annotate ${hosts[i]} secret=hco-ssh-auth
kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s label --overwrite ${hosts[i]} node-type=controlplane
kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s label --overwrite ${hosts[i]} kubernetes.io/role=master
done
cd ${AIRSHIPCTL_PROJECT}
./tools/deployment/35_deploy_worker_node.sh
@ -41,5 +63,5 @@ do
kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s label ${hosts[i]} kubernetes.io/role=master
--request-timeout 10s label --overwrite ${hosts[i]} kubernetes.io/role=master
done