Move Helm client install to separate script

To deploy Calico with Tigera Operator helm charts it was necessary
to move Helm client install to separate script for earlier execution.

Change-Id: Iab738b4120c0ac823b247b04f0cd750de0147779
This commit is contained in:
Jakub Darmach 2024-02-08 14:49:00 +01:00 committed by Michal Nasiadka
parent e3aaa89376
commit b6e2aa8af7
3 changed files with 42 additions and 21 deletions

View File

@ -17,32 +17,11 @@ if [ ! -z "$NO_PROXY" ]; then
export NO_PROXY
fi
ssh_cmd="ssh -F /srv/magnum/.ssh/config root@localhost"
echo "Waiting for Kubernetes API..."
until [ "ok" = "$(kubectl get --raw='/healthz')" ]; do
sleep 5
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_history_cmd="helm history magnum --namespace kube-system"
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-cinder-csi.sh
# Helm Based Installation Configuration Scripts
- get_file: ../../common/templates/kubernetes/fragments/install-helm.sh
- get_file: ../../common/templates/kubernetes/helm/metrics-server.sh
- str_replace:
template: {get_file: ../../common/templates/kubernetes/helm/prometheus-operator.sh}