TIL - Helm respect current replicas
When you upgrade deployed Helm chart, you probably have replicas defined in
values or pass it through set.
But sometimes it’s useful to respect the current amount of replicas, for example:
- If you’re using Horizontal Pod Autoscaler
- If you’re managing replicas through external automatization/script.
During my tests, Helm had the following behavior:
- If
replicasdefined, but has an empty number:- Helm2 will preserve the current amount of replicas
- Helm3 will reset the amount of replicas to 1
- If
replicasis not defined(not in the rendered template), both Helm2 and Helm3 will respect current replicas. The amount of replicas gets reset to 1 only in one case:replicaCountis defined in values and Helm chart is deployed with that valuesreplicaCountremoved from the values and the chart is upgraded with the new values- actual replicas become 1
See Issue 7090 for more details.
Comments