devstack: Install sonobuoy and kubectl

Change-Id: I26aa7e7065913be987bc5b298809c918977ba753
This commit is contained in:
Michal Nasiadka 2023-09-06 06:32:01 +02:00
parent 327861ac43
commit 1793251293
2 changed files with 17 additions and 0 deletions

View File

@ -348,6 +348,19 @@ function install_magnum {
setup_develop $MAGNUM_DIR
}
# install_sonobuoy() - Download and extract sonobuoy
function install_sonobuoy {
MAGNUM_SONOBUOY_TAG=${MAGNUM_SONOBUOY_TAG:-$(wget -qO- https://api.github.com/repos/vmware-tanzu/sonobuoy/releases/latest | grep tag_name | awk '{ print $2}' | tr -d \",)}
wget -t 2 -c -qO- https://github.com/vmware-tanzu/sonobuoy/releases/download/$MAGNUM_SONOBUOY_TAG/sonobuoy_${MAGNUM_SONOBUOY_TAG:1}_linux_amd64.tar.gz | sudo tar -zxf - -C /opt/stack/bin sonobuoy
}
# install_kubectl() - Download and extract kubectl
function install_kubectl {
MAGNUM_KUBECTL_TAG=${MAGNUM_KUBECTL_TAG:-$(wget -qO- https://dl.k8s.io/release/stable.txt)}
sudo wget -t 2 -c -q -O /opt/stack/bin/kubectl https://dl.k8s.io/release/${MAGNUM_KUBECTL_TAG}/bin/linux/amd64/kubectl
sudo chmod +x /opt/stack/bin/kubectl
}
# start_magnum_api() - Start the API process ahead of other things
function start_magnum_api {
run_process magnum-api "$(which uwsgi) --procname-prefix magnum-api --ini $MAGNUM_UWSGI_CONF"

View File

@ -31,6 +31,10 @@ if is_service_enabled magnum-api magnum-cond; then
create_magnum_accounts
fi
# Install kubectl and sonobuoy
install_kubectl
install_sonobuoy
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# Initialize magnum
init_magnum