How to get the HostName of the machine in which node and pod are deployed in kubernetes

Asking for help? Comment out what you need so we can get more information to help you!
How to get the HostName of the machine in which node and pod are deployed in kubernetes?
HostIP we are able to retrieve by using environment variables in yaml ,
env

  • name: PODIP
    valueFrom:
    fieldRef:
    fieldPath: status.hostIP.
    How to get hostName?

Cluster information:

Kubernetes version:
Cloud being used: (put bare-metal if not on a public cloud)
Installation method:
Host OS:
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.