<p>I am writing a statefulset and I need to export the POD_HOST+abc as an environment variable.
The second environment variable should be named differently from the POD_HOST</p>

<p>I did something like</p>

<pre><code>      env:
        - name: POD_HOST
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_FULL_NAME
          value: $POD_HOST"abc"
</code></pre>

<p>which I can see as being exported in the environment as $POD_HOST"abc". Is there a way I can make the POD_HOST resolved in the kubernetes pod before being exported in the environment</p>

<p>You just need to use parentheses for using environment variable inside environment variable.</p>

<p>Example :</p>

<pre><code>      env:
      - name: POD_HOST
        valueFrom:
          fieldRef:
            apiVersion: v1
            fieldPath: metadata.name
      - name: POD_FULL_NAME
        value: $(POD_HOST)-abc
</code></pre>
