Has anyone figured out any way to manipulate the chart (not values.yaml) when installing Helm charts?
For example, I have a bash script that basically does
helm3 upgrade --install <options>
Regardless of whatever the value of resources.limits.cpu is in any of my charts, I want to set it to a specific value when installing any charts. If all my charts were using {{ .Values.resources.limits.cpu }} I could use --set but my charts are inconsistent. Long term, proper solution is to have consistent charts, but I'm looking for a quick and dirty way.
I don't think you can change it with helm. But you could try using mutating webhook like the one here: https://github.com/garethr/kubernetes-webhook-examples/blob/master/src/app.py#L38-L41 to alter pods spec in flight as they are being created.
But if you are not using any helm specific features and use it only as templating engine, you can try the following quick and dirty hack:
helm template . | yq e '.spec.template.spec.containers[].resources.limits.cpu = "123"' /dev/stdin
Notice the use of helm template (to render templates) an yq (to change limit values)