Merge "Move Helm client install to separate script"

This commit is contained in:
Zuul 2024-03-05 12:33:14 +00:00 committed by Gerrit Code Review
commit a69f8297f3
3 changed files with 42 additions and 21 deletions

View File

@ -17,32 +17,11 @@ if [ ! -z "$NO_PROXY" ]; then
export NO_PROXY export NO_PROXY
fi fi
ssh_cmd="ssh -F /srv/magnum/.ssh/config root@localhost"
echo "Waiting for Kubernetes API..." echo "Waiting for Kubernetes API..."
until [ "ok" = "$(kubectl get --raw='/healthz')" ]; do until [ "ok" = "$(kubectl get --raw='/healthz')" ]; do
sleep 5 sleep 5
done done
if [ -z "${HELM_CLIENT_URL}" ] ; then
HELM_CLIENT_URL="https://get.helm.sh/helm-$HELM_CLIENT_TAG-linux-amd64.tar.gz"
fi
i=0
until curl -o /srv/magnum/helm-client.tar.gz "${HELM_CLIENT_URL}"; do
i=$((i + 1))
[ $i -lt 5 ] || break;
sleep 5
done
if ! echo "${HELM_CLIENT_SHA256} /srv/magnum/helm-client.tar.gz" | sha256sum -c - ; then
echo "ERROR helm-client.tar.gz computed checksum did NOT match, exiting."
exit 1
fi
source /etc/bashrc
$ssh_cmd tar xzvf /srv/magnum/helm-client.tar.gz linux-amd64/helm -O > /srv/magnum/bin/helm
$ssh_cmd chmod +x /srv/magnum/bin/helm
helm_install_cmd="helm upgrade --install magnum . --namespace kube-system --values values.yaml --render-subchart-notes" helm_install_cmd="helm upgrade --install magnum . --namespace kube-system --values values.yaml --render-subchart-notes"
helm_history_cmd="helm history magnum --namespace kube-system" helm_history_cmd="helm history magnum --namespace kube-system"
if [[ "${HELM_CLIENT_TAG}" == v2.* ]]; then if [[ "${HELM_CLIENT_TAG}" == v2.* ]]; then

View File

@ -0,0 +1,41 @@
step="install-helm"
echo "START: ${step}"
set +x
. /etc/sysconfig/heat-params
set -ex
if [ ! -z "$HTTP_PROXY" ]; then
export HTTP_PROXY
fi
if [ ! -z "$HTTPS_PROXY" ]; then
export HTTPS_PROXY
fi
if [ ! -z "$NO_PROXY" ]; then
export NO_PROXY
fi
ssh_cmd="ssh -F /srv/magnum/.ssh/config root@localhost"
if [ -z "${HELM_CLIENT_URL}" ] ; then
HELM_CLIENT_URL="https://get.helm.sh/helm-$HELM_CLIENT_TAG-linux-amd64.tar.gz"
fi
i=0
until curl -o /srv/magnum/helm-client.tar.gz "${HELM_CLIENT_URL}"; do
i=$((i + 1))
[ $i -lt 5 ] || break;
sleep 5
done
if ! echo "${HELM_CLIENT_SHA256} /srv/magnum/helm-client.tar.gz" | sha256sum -c - ; then
echo "ERROR helm-client.tar.gz computed checksum did NOT match, exiting."
exit 1
fi
source /etc/bashrc
$ssh_cmd tar xzvf /srv/magnum/helm-client.tar.gz linux-amd64/helm -O > /srv/magnum/bin/helm
$ssh_cmd chmod +x /srv/magnum/bin/helm
echo "END: ${step}"

View File

@ -1417,6 +1417,7 @@ resources:
- get_file: ../../common/templates/kubernetes/fragments/enable-auto-scaling.sh - get_file: ../../common/templates/kubernetes/fragments/enable-auto-scaling.sh
- get_file: ../../common/templates/kubernetes/fragments/enable-cinder-csi.sh - get_file: ../../common/templates/kubernetes/fragments/enable-cinder-csi.sh
# Helm Based Installation Configuration Scripts # Helm Based Installation Configuration Scripts
- get_file: ../../common/templates/kubernetes/fragments/install-helm.sh
- get_file: ../../common/templates/kubernetes/helm/metrics-server.sh - get_file: ../../common/templates/kubernetes/helm/metrics-server.sh
- str_replace: - str_replace:
template: {get_file: ../../common/templates/kubernetes/helm/prometheus-operator.sh} template: {get_file: ../../common/templates/kubernetes/helm/prometheus-operator.sh}