We’re using Helm to deploy services to K8s for several clients we’re supporting. Helm gives you the option to install and upgrade releases in your K8s clusters. As part of this process, the ability to know if the release has ended successfully or not is very important (whether to rollback or not). Helm does this by utilizing an ability to read the deployment status of k8s resources. K8s provides Helm several “metrics” about its health, for example: liveness of the Pod, service’s lack of an endpoint, Pod restart and more. Helm provides the option to add a “wait” and “timeout” flags to install and upgrade commands.
From Helm formal documentation:
Wait: 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.
Timeout: time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks) (default 300).
Helm is a great tool with many pros BUT unfortunately, we found a major issue with the Wait flag; The Wait flag is used to let Helm server (Tiller) know that we want to wait for the command to finish to understand the status, the issue is the Wait flag supports only K8s resources under the V1 API. So if you use K8s resources in other API namespaces the Wait flag will be usable.
Here you can find the official issue in Helm Github repository:
“wait flag does not wait for deployment pod readiness properly”
And another comment from Helm tests:
“For deployments — wait may not be sufficient because it looks at ‘maxUnavailable’ which is 0 by default”
We use a workaround to solve this issue, for now, the Kubectl command:
This command uses Kubectl to get the health of the deployment and then we can check the status of the deployment act depending on the result.