<p>Is there a way to use an environment variable as the default for another? For example:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: Work
spec:
  containers:
  - name: envar-demo-container
    image: gcr.io/google-samples/node-hello:1.0
    env:
    - name: ALWAYS_SET
      value: &quot;default&quot;
    - name: SOMETIMES_SET
      value: &quot;custom&quot;

    - name: RESULT
      value: &quot;$(SOMETIMES_SET) ? $(SOMETIMES_SET) : $(ALWAYS_SET)&quot;
</code></pre>

hpohl
<p>I don't think there is a way to do that but anyway you can try something like this</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: Work
spec:
  containers:
  - name: envar-demo-container
    image: gcr.io/google-samples/node-hello:1.0
    args:
    - RESULT=${SOMETIMES_SET:-${ALWAYS_SET}}; command_to_run_app
    command:
    - sh
    - -c
    env:
    - name: ALWAYS_SET
      value: &quot;default&quot;
    - name: SOMETIMES_SET
      value: &quot;custom&quot;
</code></pre>
