<p>In kubernetes we can use environment variable to pass hostIP using</p>
<pre><code> env:
    - name: NODE_IP
      valueFrom:
        fieldRef:
          fieldPath: status.hostIP
</code></pre>
<p>So similarly how get hostName instead of HostIP?</p>

Shreyas Holla P
<pre><code>env:
- name: MY_NODE_NAME
  valueFrom:
    fieldRef:
      fieldPath: spec.nodeName
</code></pre>
<p>See: <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api</a></p>
