Armada command integration

This PS integrates armada command to tools/airship wrapper script.

Change-Id: I80fb6d8ebb14cc7a84f350a324ec3e847f5654d4
This commit is contained in:
Sergiy Markin 2024-03-12 21:56:42 +00:00
parent e8b6c62261
commit 051f8c7543
2 changed files with 25 additions and 10 deletions

View File

@ -119,6 +119,7 @@ Examples:
tools/airship promenade generate-certs -o /target/certs /target/collect/*.yaml
tools/airship promenade build-all -o /target/bundle /target/collect/*.yaml /target/certs/*.yaml
tools/airship shipyard get actions
tools/airship armada apply actions
"
}
@ -189,13 +190,29 @@ shipyard() {
versions_lookup "['data']['images']['ucp']['shipyard']['shipyard']"
SHIPYARD_IMAGE=$RESULT
IMAGE_SHIPYARD=$IMAGE_URL
docker run --rm --net=host $TERM_OPTS \
-u "${USER}:${GROUP}" \
-w /target \
-v $(pwd):/target \
--env-file $ENV_FILE \
$IMAGE_URL $@
$IMAGE_SHIPYARD $@
}
armada() {
versions_lookup "['data']['images']['ucp']['armada']['api']"
IMAGE_ARMADA=$IMAGE_URL
docker run --rm --net host $TERM_OPTS \
-u "${USER}:${GROUP}" \
-v ${HOME}/.kube/config:/armada/.kube/config \
-v "$(pwd)"/airskiff.yaml:/airskiff.yaml \
-v "${REPO_DIR}"/../:/airship-components \
--env-file $ENV_FILE \
$IMAGE_ARMADA $@
}
@ -210,6 +227,10 @@ case "$1" in
shift;
shipyard $@
;;
'armada')
shift;
armada $@
;;
*) help
exit 1
;;

View File

@ -20,9 +20,8 @@ set -xe
: "${INSTALL_PATH:="$(pwd)/../"}"
: "${PEGLEG:="./tools/airship pegleg"}"
: "${PL_SITE:="airskiff"}"
: "${ARMADA:="./tools/airship armada"}"
: "${TARGET_MANIFEST:="cluster-bootstrap"}"
: "${DISTRO:=ubuntu_focal}"
: "${DOCKER_REGISTRY:=quay.io}"
# Render documents
@ -37,12 +36,7 @@ sudo chmod 0644 airskiff.yaml
# sudo chmod 0644 ~/.kube/config
# Download latest Armada image and deploy Airship components
docker run --rm --net host -p 8000:8000 --name armada \
-v ~/.kube/config:/armada/.kube/config \
-v "$(pwd)"/airskiff.yaml:/airskiff.yaml \
-v "${INSTALL_PATH}":/airship-components \
"${DOCKER_REGISTRY}/airshipit/armada:latest-${DISTRO}" \
apply /airskiff.yaml --debug --target-manifest "${TARGET_MANIFEST}"
${ARMADA} apply /airskiff.yaml --debug --target-manifest "${TARGET_MANIFEST}"
# # Set back permissions of the files
sudo chmod "${AIRSKIFF_PERMISSIONS}" airskiff.yaml