[k8s] Use helm upgrade --install in deployment loop

Sometimes, the chart may fail to deploy, e.g. if the worker node is not
ready before chart deployment times out. Retry until status is deployed.

Story: 2007514
Task: 40276

Change-Id: I8fd5cc154e86006e9139d5ac5f282d0b460eca37
(cherry picked from commit a008e3b44f)
This commit is contained in:
Bharat Kunwar 2020-07-03 09:25:39 +00:00
parent e0fecc1dd3
commit b699e0c998
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ else
$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 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"
if [[ "${HELM_CLIENT_TAG}" == v2.* ]]; then
CERTS_DIR="/etc/kubernetes/helm/certs"
@ -64,7 +64,7 @@ else
until helm init --client-only --wait; do
sleep 5s
done
helm_install_cmd="helm install --name magnum . --namespace kube-system --values values.yaml --render-subchart-notes"
helm_install_cmd="helm upgrade --install --name magnum . --namespace kube-system --values values.yaml --render-subchart-notes"
helm_history_cmd="helm history magnum"
fi
@ -81,7 +81,7 @@ EOF
sed -i '1i\dependencies:' requirements.yaml
i=0
until ($helm_history_cmd | grep magnum) || (helm dep update && $helm_install_cmd); do
until ($helm_history_cmd | grep magnum | grep deployed) || (helm dep update && $helm_install_cmd); do
i=$((i + 1))
[ $i -lt 60 ] || break;
sleep 5