Kubernetes automatically generates several environment variables for you, like SERVICE1_SERVICE_HOST
and SERVICE1_SERVICE_PORT
. I would like to use the value of these variables to set my own variables in the deployment.yml, like below:
env:
- name: MY_NEW_VAR
value: ${SERVICE1_SERVICE_HOST}
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 MY_NEW_VAR = ${SERVICE1_SERVICE_HOST}.
Is there a way to assign the value of ${SERVICE1_SERVICE_HOST}
instead?
The syntax is $(SERVICE1_SERVICE_HOST)
, as one can see in the fine manual