From 404b32ef875df18cec9ea97448bd8da35163487f Mon Sep 17 00:00:00 2001 From: James Gu Date: Wed, 14 Apr 2021 14:08:38 -0700 Subject: [PATCH] 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 Change-Id: Ied0d8712fd154e8e7c979a551417a6429c148456 --- tools/deployment/35_deploy_worker_node.sh | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tools/deployment/35_deploy_worker_node.sh b/tools/deployment/35_deploy_worker_node.sh index 50f4c5ef1..ad95a3cfb 100755 --- a/tools/deployment/35_deploy_worker_node.sh +++ b/tools/deployment/35_deploy_worker_node.sh @@ -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