<p>I have two env vars in a pod (or a config map):<br>
- <code>TARGET_URL=http://www.example.com</code><br>
- <code>TARGET_PARAM=param</code></p>

<p>Is there any way for me to provide a third env var which is derived from both these vars, something like <code>${TARGET_URL}/mysite/${TARGET_PARAM}</code>.</p>

<p>Thanks!</p>

Pavel Tarno
<p>I don't think it is possible right now, without a 3rd party tool. regarding <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#envvarsource-v1-core" rel="nofollow noreferrer">api ref</a> it does not support multi variable in YAML. But I will tell you about a 3rd party tool -- Helm</p>

<p>It is possible to achieve it using Helm. your template will look like:</p>

<pre><code> containers:
    - name: {{.Values.Backend.name }}
      image: "{{ .Values.Backend.image.repository }}:{{ .Values.Backend.image.tag }}"
      imagePullPolicy: "{{ .Values.Backend.image.pullPolicy }}"
      args:
        - name: TARGET_URL
          value: {{ .Value.URL}}
        - name: TARGET_PARAM
          value: {{ .Value.PARAM}}
        - name: URL
          value: {{ .Value.URL }}/mysite/{{ .Value.PARAM}}
</code></pre>

<p>and you will add to the file <code>values.yaml</code> parameters for  <code>TARGET_URL</code> and <code>TARGET_PARAM</code></p>

<pre><code>URL: http://www.example.com
PARAM: param          
</code></pre>
