Fix deployment scripts

* add $ for kubectl command in host variable
 * remove controlplane labels as they are added via k8scontrol role

Signed-off-by: Sreejith Punnapuzha <Sreejith.Punnapuzha@outlook.com>
Change-Id: Idc30a6704504dc151f7da4c6d551d2f8854bdd79
This commit is contained in:
Sreejith Punnapuzha 2021-04-19 11:56:28 -05:00
parent 4afe0b43f9
commit 868a737775
2 changed files with 10 additions and 13 deletions

View File

@ -22,7 +22,7 @@ cd ${AIRSHIPCTL_PROJECT}
./tools/deployment/31_deploy_initinfra_target_node.sh
hosts=(kubectl \
hosts=$(kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s get nodes -o name)
@ -33,11 +33,7 @@ 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
--request-timeout 10s annotate --overwrite ${hosts[i]} secret=hco-ssh-auth
kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \

View File

@ -18,6 +18,11 @@ export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
export WORKER_NODE=${WORKER_NODE:-"$(airshipctl phase render workers-target \
-k BareMetalHost 2> /dev/null | \
yq .metadata.name | \
sed 's/"//g')"}
# Annotate node for hostconfig-operator
hosts=(kubectl \
--kubeconfig $KUBECONFIG \
@ -29,11 +34,7 @@ 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
--request-timeout 10s annotate --overwrite ${hosts[i]} secret=hco-ssh-auth
kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
@ -43,7 +44,7 @@ done
cd ${AIRSHIPCTL_PROJECT}
./tools/deployment/35_deploy_worker_node.sh
hosts=(kubectl \
hosts=$(kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s get nodes -o name)
@ -54,7 +55,7 @@ do
kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s annotate ${hosts[i]} secret=hco-ssh-auth
--request-timeout 10s annotate --overwrite ${hosts[i]} secret=hco-ssh-auth
kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \