Create secret with ssh-key for hostconfig-operator

This commit adds secret creation to hostconfig-operator.

Signed-off-by: Sreejith Punnapuzha <Sreejith.Punnapuzha@outlook.com>
Change-Id: I8a92a07e1aaf653708b6e4d9fa8e300ebb3a9468
(cherry picked from commit 87a82989b6)
This commit is contained in:
Sreejith Punnapuzha 2021-04-08 22:26:16 -05:00 committed by Drew Walters
parent b734c5549a
commit 6b81b829df
2 changed files with 25 additions and 1 deletions

View File

@ -46,6 +46,10 @@ do
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s annotate --overwrite ${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 \

View File

@ -14,6 +14,8 @@
set -ex
export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
export TARGET_IP=${TARGET_IP:-"$(airshipctl phase render controlplane-target \
@ -29,4 +31,22 @@ export TARGET_PORT=${TARGET_PORT:-"$(airshipctl phase render controlplane-target
echo $TARGET_IP $TARGET_PORT
cd ${AIRSHIPCTL_PROJECT}
./tools/deployment/34_deploy_controlplane_target.sh
./tools/deployment/34_deploy_worker_node.sh
hosts=$(kubectl \
--kubeconfig $KUBECONFIG \
--context $KUBECONFIG_TARGET_CONTEXT \
--request-timeout 10s get nodes -o name)
# Annotate node for hostconfig-operator
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 ${hosts[i]} kubernetes.io/role=master
done