AKS Kubernetes with Azure DevOps Pipeline - helm upgrade error

12/14/2018

I'm a complete Azure DevOps noob, trying to set up an AKS cluster and a Release pipeline in Azure DevOps to deploy to it using Helm.

I created (with RBAC disabled, to simplify process) an AKS cluster, connected a Release pipeline to it, connected to the AKS cluster using the Azure Cloud Shell and ran helm init, but the release is failing with this problem:

2018-12-14T16:35:55.9461744Z ##[section]Starting: helm upgrade <REDACTED>
2018-12-14T16:35:55.9467164Z ==============================================================================
2018-12-14T16:35:55.9467299Z Task         : Package and deploy Helm charts
2018-12-14T16:35:55.9467387Z Description  : Deploy, configure, update your Kubernetes cluster in Azure Container Service by running helm commands.
2018-12-14T16:35:55.9467647Z Version      : 0.138.14
2018-12-14T16:35:55.9467963Z Author       : Microsoft Corporation
2018-12-14T16:35:55.9468016Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=851275)
2018-12-14T16:35:55.9468114Z ==============================================================================
2018-12-14T16:35:58.3023980Z [command]/opt/hostedtoolcache/helm/2.11.0/x64/linux-amd64/helm upgrade --namespace dev --install --recreate-pods --force --values /home/vsts/work/r1/a/_<REDACTED>/helm-charts/<REDACTED>/values-dev.yaml --set image.tag=development --wait <REDACTED> /home/vsts/work/r1/a/_<REDACTED>/helm-charts/<REDACTED>
2018-12-14T16:40:57.6309603Z Release "<REDACTED>" does not exist. Installing it now.
2018-12-14T16:40:57.6311297Z Error: release <REDACTED> failed: timed out waiting for the condition
2018-12-14T16:40:57.6428880Z ##[error]Error: release <REDACTED> failed: timed out waiting for the condition

2018-12-14T16:40:57.6440575Z ##[section]Finishing: helm upgrade <REDACTED>

(Note, redacted out sensitive project names).

-- Scott Shorkey
azure
azure-aks
azure-devops
kubernetes
kubernetes-helm

1 Answer

12/17/2018

Since you are using --wait flag for your deployment

if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout

If you have any jobs or hooks that run longer than 300 seconds, you can set --timeout n flag with number of seconds your jobs require to complete.

If you don't have any jobs running within your deployment:

  • Check that all your pods are in Ready state. If you have any pods in, for example, CrashLoopBackoff state, helm will fail with timeout.
  • Find optimal timeout if your pods are taking more than 300 seconds to be in Ready state.
-- edbighead
Source: StackOverflow