kubernetes-helm

How does helm upgrade handle the deployment update?


Let's say we have a helm chart for an app and we want to upgrade that app over time by changing the deployment's image version and use: helm upgrade --install my-app-release; The question is: does helm use the rolling update strategy defined in the deployment manifest or does it handle upgrading differently?


Solution

  • It uses the strategy defined in the deployment manifest.

    Technically the update strategy defined in the deployment manifest is applied every time the PodSpec changes, no matter whether it changes through helm or kubectl or something else. And only if the PodSpec changes.

    It's instructive to see how kubectl rollout restart (i.e. the kubectl command to manually trigger the update strategy) works: How to rolling restart pods without changing deployment yaml in kubernetes?

    Note that changing an annotation on the Deployment won't trigger a rollout, the changed annotation has to be on the Pod.