Enhanced deployment scripts to support baremetal multi-node
Additionally aligned between Treasuremap and Airshipctl to use the same environment variable name "SITE" for a site name. Change-Id: Id6405b7074d34bc73d730eea76d9dd6ab7901405 Signed-off-by: James Gu <james.gu@att.com>
This commit is contained in:
parent
52c92a9c28
commit
ad658328ef
@ -2,3 +2,4 @@
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=airship/treasuremap.git
|
||||
defaultbranch=v2
|
||||
|
@ -14,9 +14,18 @@
|
||||
|
||||
set -xe
|
||||
|
||||
pkg_check() {
|
||||
for pkg in $@; do
|
||||
sudo dpkg -s $pkg &> /dev/null || sudo DEBIAN_FRONTEND=noninteractive apt -y install $pkg
|
||||
done
|
||||
}
|
||||
|
||||
pkg_check software-properties-common curl wget ca-certificates docker.io make
|
||||
|
||||
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
|
||||
|
||||
cd ${AIRSHIPCTL_PROJECT}
|
||||
./tools/deployment/provider_common/02_install_jq.sh
|
||||
./tools/deployment/provider_common/03_install_pip.sh
|
||||
./tools/deployment/provider_common/04_install_yq.sh
|
||||
./tools/deployment/01_install_kubectl.sh
|
||||
|
@ -17,8 +17,8 @@ set -xe
|
||||
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
|
||||
: ${TREASUREMAP_PROJECT:="$(pwd)"}
|
||||
|
||||
export AIRSHIP_SITE_NAME=${AIRSHIP_SITE_NAME:-"test-site"}
|
||||
export AIRSHIP_CONFIG_METADATA_PATH=${AIRSHIP_CONFIG_METADATA_PATH:-"treasuremap/manifests/site/$AIRSHIP_SITE_NAME/metadata.yaml"}
|
||||
export SITE=${SITE:-"test-site"}
|
||||
export AIRSHIP_CONFIG_METADATA_PATH=${AIRSHIP_CONFIG_METADATA_PATH:-"treasuremap/manifests/site/$SITE/metadata.yaml"}
|
||||
export AIRSHIP_CONFIG_MANIFEST_DIRECTORY=${AIRSHIP_CONFIG_MANIFEST_DIRECTORY:-"/tmp/treasuremap"}
|
||||
|
||||
# Primary repo options
|
||||
|
@ -17,8 +17,8 @@ set -xe
|
||||
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
|
||||
: ${TREASUREMAP_PROJECT:="$(pwd)"}
|
||||
|
||||
export AIRSHIP_SITE_NAME=${AIRSHIP_SITE_NAME:-"test-site"}
|
||||
export AIRSHIP_CONFIG_METADATA_PATH=${AIRSHIP_CONFIG_METADATA_PATH:-"treasuremap/manifests/site/$AIRSHIP_SITE_NAME/metadata.yaml"}
|
||||
export SITE=${SITE:-"test-site"}
|
||||
export AIRSHIP_CONFIG_METADATA_PATH=${AIRSHIP_CONFIG_METADATA_PATH:-"treasuremap/manifests/site/$SITE/metadata.yaml"}
|
||||
# Setting the same value as targetPath that gets updated after create config step (22_test_configs.sh)
|
||||
export AIRSHIP_CONFIG_MANIFEST_DIRECTORY=${AIRSHIP_CONFIG_MANIFEST_DIRECTORY:-"/tmp/default"}
|
||||
|
||||
|
@ -15,17 +15,22 @@
|
||||
set -ex
|
||||
|
||||
export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"}
|
||||
NODENAME="node01"
|
||||
export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"}
|
||||
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
|
||||
|
||||
TARGET_NODE=${TARGET_NODE:-"$(airshipctl phase render controlplane-ephemeral \
|
||||
-k BareMetalHost -l airshipit.org/k8s-role=controlplane-host \
|
||||
2> /dev/null | \
|
||||
yq .metadata.name | \
|
||||
sed 's/"//g')"}
|
||||
|
||||
cd ${AIRSHIPCTL_PROJECT}
|
||||
|
||||
kubectl \
|
||||
--kubeconfig $KUBECONFIG \
|
||||
--context $KUBECONFIG_TARGET_CONTEXT \
|
||||
--request-timeout 10s \
|
||||
label node $NODENAME node-type=controlplane
|
||||
label nodes $TARGET_NODE node-type=controlplane
|
||||
|
||||
./tools/deployment/31_deploy_initinfra_target_node.sh
|
||||
|
||||
|
@ -16,5 +16,10 @@ set -ex
|
||||
|
||||
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
|
||||
|
||||
export WORKER_NODE=${WORKER_NODE:-"$(airshipctl phase render workers-target \
|
||||
-k BareMetalHost 2> /dev/null | \
|
||||
yq .metadata.name | \
|
||||
sed 's/"//g')"}
|
||||
|
||||
cd ${AIRSHIPCTL_PROJECT}
|
||||
./tools/deployment/34_deploy_worker_node.sh
|
||||
|
@ -16,5 +16,17 @@ set -ex
|
||||
|
||||
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
|
||||
|
||||
export TARGET_IP=${TARGET_IP:-"$(airshipctl phase render controlplane-target \
|
||||
-k Metal3Cluster \
|
||||
-l airshipit.org/stage=initinfra \
|
||||
2> /dev/null | \
|
||||
yq .spec.controlPlaneEndpoint.host |
|
||||
sed 's/"//g')"}
|
||||
export TARGET_PORT=${TARGET_PORT:-"$(airshipctl phase render controlplane-target \
|
||||
-k Metal3Cluster -l airshipit.org/stage=initinfra \
|
||||
2> /dev/null | \
|
||||
yq .spec.controlPlaneEndpoint.port)"}
|
||||
|
||||
echo $TARGET_IP $TARGET_PORT
|
||||
cd ${AIRSHIPCTL_PROJECT}
|
||||
./tools/deployment/35_deploy_workload.sh
|
||||
|
Loading…
Reference in New Issue
Block a user