How to feed kubernetes hostname as env variable

I’m creating a workload that is intended to run as a cronjob and run on every etcd node.

How can I feed to kubernetes nodename to the container as an environment variable? Is there any kind of variable substitution you can do in a pod spec?


check this out