<p>Kubernetes automatically generates several environment variables for you, like <code>SERVICE1_SERVICE_HOST</code> and <code>SERVICE1_SERVICE_PORT</code>. I would like to use the value of these variables to set my own variables in the deployment.yml, like below:</p>

<pre><code>env:
- name: MY_NEW_VAR
  value: ${SERVICE1_SERVICE_HOST}
</code></pre>

<p>For some reason Kubernetes isn't able to resolve this. When I go inside the container it turns out it has been assigned as a literal string, giving me <code>MY_NEW_VAR = ${SERVICE1_SERVICE_HOST}.</code></p>

<p>Is there a way to assign the value of <code>${SERVICE1_SERVICE_HOST}</code> instead?</p>

DraegerMTN
<p>The syntax is <code>$(SERVICE1_SERVICE_HOST)</code>, as one can see in <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config" rel="nofollow noreferrer">the fine manual</a></p>
