From 52601d911fea958b45413801f03e24b831be127e Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Tue, 29 Mar 2022 11:13:01 +1100 Subject: [PATCH] feat: add a timeout on the rollout status watch --- .../kubectl-build-deploy-dind/scripts/exec-monitor-deploy.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/kubectl-build-deploy-dind/scripts/exec-monitor-deploy.sh b/images/kubectl-build-deploy-dind/scripts/exec-monitor-deploy.sh index 63903fb679..39ef1d8bf5 100755 --- a/images/kubectl-build-deploy-dind/scripts/exec-monitor-deploy.sh +++ b/images/kubectl-build-deploy-dind/scripts/exec-monitor-deploy.sh @@ -32,7 +32,10 @@ stream_logs_deployment & STREAM_LOGS_PID=$! ret=0 -kubectl rollout --insecure-skip-tls-verify -n ${NAMESPACE} status deployment ${SERVICE_NAME} --watch || ret=$? +# default progressDeadlineSeconds is 600, doubling that here for a timeout on the status check for 1200s (20m) as a fallback for exceeding the progressdeadline +# when there may be another issue with the rollout failing, the progresdeadline doesn't always work +# (eg, existing pod in previous replicaset fails to terminate properly) +kubectl rollout --insecure-skip-tls-verify -n ${NAMESPACE} status deployment ${SERVICE_NAME} --watch --timeout=1200s || ret=$? if [[ $ret -ne 0 ]]; then # stop all running stream logs