<p>Im using this helm chart to deploy: <a href="https://github.com/helm/charts/tree/master/stable/atlantis" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/stable/atlantis</a></p>

<p>It deploys this stateful set: <a href="https://github.com/helm/charts/blob/master/stable/atlantis/templates/statefulset.yaml" rel="nofollow noreferrer">https://github.com/helm/charts/blob/master/stable/atlantis/templates/statefulset.yaml</a></p>

<p>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</p>

<p>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?</p>

<p>EDIT: what Im talking about is adding an env var like this:</p>

<pre><code>env:
- name: GET_THIS_VAR_IN_ATLANTIS
  valueFrom:
    secretKeyRef:
      name: my-secret
      key: abc
</code></pre>

<p>Maybe I can create another chart as a parent of this chart and override the entire <code>env:</code> block?</p>

<blockquote>
  <p>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?</p>
</blockquote>

<p>You can only make changes that the chart itself supports.</p>

<p>If you look at the StatefulSet definition you linked to, there are a lot of <code>{{ if .Values.foo }}</code> knobs there.  This is an fairly customizable chart and you probably can change most things.  As a chart author, you'd have to explicitly write all of these conditionals and macro expansions in.</p>

<blockquote>
  <p>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</p>
</blockquote>

<p>This very specific chart contains a block</p>

<pre><code>{{- range $key, $value := .Values.environment }}
- name: {{ $key }}
  value: {{ $value | quote }}
{{- end }}
</code></pre>

<p>so you could write a custom Helm YAML values file and add in</p>

<pre><code>environment:
  arbitraryKey: "any fixed value you want"
</code></pre>

<p>and then use the <code>helm install -f</code> option to supply that option when you install the chart.</p>

<p>This chart does not support injecting environment values from secrets, beyond a half-dozen specific values it supports by default (<em>e.g.</em>, GitHub tokens).</p>

<p>As I say, this isn't generic at all: this is very specific to what this specific chart supports in its template expansions.</p>
