Search code examples
kubernetesgoogle-cloud-platformgoogle-kubernetes-enginekubernetes-helm

Can I add arbitrary config to a pod spec deployed with a helm chart without modifying the Helm chart?


I'm using this Helm chart to deploy: https://github.com/helm/charts/tree/master/stable/atlantis

It deploys this stateful set: https://github.com/helm/charts/blob/master/stable/atlantis/templates/statefulset.yaml

Is there a way I can add arbitrary config values to a pod spec that was deployed with a Helm chart without having to modify the chart? For example I want to add an env: var that gets its value from a secret to the pod spec of the stateful set this chart deploys

Can I create my own Helm chart that references this Helm chart and add to the config of the pod spec? again without modifying the original chart?

EDIT: what I'm talking about is adding an env var like this:

env:
- name: GET_THIS_VAR_IN_ATLANTIS
  valueFrom:
    secretKeyRef:
      name: my-secret
      key: abc

Maybe I can create another chart as a parent of this chart and override the entire env: block?


Solution

  • Should have marked the previous answer as the answer but things have changed in helm3.

    While there is still no built-in way of patching a chart there is now builtin support for a "post renderer" https://helm.sh/docs/topics/advanced/

    So, calling kustomize as a post renderer would probably be what most would suggest now with helm3