Skip to content

Commit a69f829

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Move Helm client install to separate script"
2 parents 52f479c + b6e2aa8 commit a69f829

File tree

3 files changed

+42
-21
lines changed

3 files changed

+42
-21
lines changed

magnum/drivers/common/templates/kubernetes/fragments/install-helm-modules.sh

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,11 @@ if [ ! -z "$NO_PROXY" ]; then
1717
export NO_PROXY
1818
fi
1919

20-
ssh_cmd="ssh -F /srv/magnum/.ssh/config root@localhost"
21-
2220
echo "Waiting for Kubernetes API..."
2321
until [ "ok" = "$(kubectl get --raw='/healthz')" ]; do
2422
sleep 5
2523
done
2624

27-
if [ -z "${HELM_CLIENT_URL}" ] ; then
28-
HELM_CLIENT_URL="https://get.helm.sh/helm-$HELM_CLIENT_TAG-linux-amd64.tar.gz"
29-
fi
30-
i=0
31-
until curl -o /srv/magnum/helm-client.tar.gz "${HELM_CLIENT_URL}"; do
32-
i=$((i + 1))
33-
[ $i -lt 5 ] || break;
34-
sleep 5
35-
done
36-
37-
if ! echo "${HELM_CLIENT_SHA256} /srv/magnum/helm-client.tar.gz" | sha256sum -c - ; then
38-
echo "ERROR helm-client.tar.gz computed checksum did NOT match, exiting."
39-
exit 1
40-
fi
41-
42-
source /etc/bashrc
43-
$ssh_cmd tar xzvf /srv/magnum/helm-client.tar.gz linux-amd64/helm -O > /srv/magnum/bin/helm
44-
$ssh_cmd chmod +x /srv/magnum/bin/helm
45-
4625
helm_install_cmd="helm upgrade --install magnum . --namespace kube-system --values values.yaml --render-subchart-notes"
4726
helm_history_cmd="helm history magnum --namespace kube-system"
4827
if [[ "${HELM_CLIENT_TAG}" == v2.* ]]; then
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
step="install-helm"
2+
echo "START: ${step}"
3+
4+
set +x
5+
. /etc/sysconfig/heat-params
6+
set -ex
7+
8+
if [ ! -z "$HTTP_PROXY" ]; then
9+
export HTTP_PROXY
10+
fi
11+
12+
if [ ! -z "$HTTPS_PROXY" ]; then
13+
export HTTPS_PROXY
14+
fi
15+
16+
if [ ! -z "$NO_PROXY" ]; then
17+
export NO_PROXY
18+
fi
19+
20+
ssh_cmd="ssh -F /srv/magnum/.ssh/config root@localhost"
21+
22+
if [ -z "${HELM_CLIENT_URL}" ] ; then
23+
HELM_CLIENT_URL="https://get.helm.sh/helm-$HELM_CLIENT_TAG-linux-amd64.tar.gz"
24+
fi
25+
i=0
26+
until curl -o /srv/magnum/helm-client.tar.gz "${HELM_CLIENT_URL}"; do
27+
i=$((i + 1))
28+
[ $i -lt 5 ] || break;
29+
sleep 5
30+
done
31+
32+
if ! echo "${HELM_CLIENT_SHA256} /srv/magnum/helm-client.tar.gz" | sha256sum -c - ; then
33+
echo "ERROR helm-client.tar.gz computed checksum did NOT match, exiting."
34+
exit 1
35+
fi
36+
37+
source /etc/bashrc
38+
$ssh_cmd tar xzvf /srv/magnum/helm-client.tar.gz linux-amd64/helm -O > /srv/magnum/bin/helm
39+
$ssh_cmd chmod +x /srv/magnum/bin/helm
40+
41+
echo "END: ${step}"

magnum/drivers/k8s_fedora_coreos_v1/templates/kubecluster.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,7 @@ resources:
14171417
- get_file: ../../common/templates/kubernetes/fragments/enable-auto-scaling.sh
14181418
- get_file: ../../common/templates/kubernetes/fragments/enable-cinder-csi.sh
14191419
# Helm Based Installation Configuration Scripts
1420+
- get_file: ../../common/templates/kubernetes/fragments/install-helm.sh
14201421
- get_file: ../../common/templates/kubernetes/helm/metrics-server.sh
14211422
- str_replace:
14221423
template: {get_file: ../../common/templates/kubernetes/helm/prometheus-operator.sh}

0 commit comments

Comments
 (0)