<p>When I pass service name in environment variable in YAML file, that service name is still string, it's not being resolved in real ip address.</p>

<p>Example:</p>

<pre><code>env:
  - name: ES
    value: elasticsearch
</code></pre>

<p>Thanks</p>

ali bouaziz
<p>You should be able to use it directly and it should resolve fine:</p>

<pre><code>curl $ES
</code></pre>

<p>If you use it inside your application it should also work.</p>

<p>Just consider that Kubernetes uses its internal DNS and the that "elasticsearch" name should only work inside the same namespace. In fact it will resolve to:</p>

<p>elasticsearch<code>.&lt;namespace&gt;.svc.cluster.local.</code> </p>

<p>If your elastic <strong>service</strong> is running in different namespace, make sure you use <code>elastic.&lt;target_namespace&gt;</code>.</p>
