Skip to content

Commit 1b9be27

Browse files
committed
Restart tiller if it crashes
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent cb3a413 commit 1b9be27

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

entry

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ helm_content_decode() {
110110
set +e
111111
}
112112

113+
# tiller sometimes crashes and needs to be restarted to prevent helm_v2 from hanging forever.
114+
# ref: https://github.com/helm/helm/issues/4753
115+
run_tiller() {
116+
while true; do
117+
tiller --listen=127.0.0.1:44134 --storage=secret
118+
echo "Restarting tiller..."
119+
sleep 5
120+
done
121+
}
122+
113123
export SSL_CERT_FILE=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
114124
export SSL_CERT_DIR=/etc/ssl/certs
115125
export HELM_TLS_CA_CERT=${SSL_CERT_FILE}
@@ -123,7 +133,7 @@ CHART="${CHART//%\{KUBERNETES_API\}%/${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SER
123133
set +v -x
124134

125135
if [[ "${BOOTSTRAP}" != "true" ]]; then
126-
tiller --listen=127.0.0.1:44134 --storage=secret &
136+
run_tiller &
127137
export HELM_HOST=127.0.0.1:44134
128138

129139
helm_v2 init --skip-refresh --client-only --stable-repo-url ${STABLE_REPO_URL}

0 commit comments

Comments
 (0)