Creating another flag in addition to hostNetwork

Hi everyone.

I would like to propose a feature request here, and I would like to hear what you guys think about it.

what my feature request is:

I would like to have another flag in the Podspec than hostNetwork. Which will allow me to get the node’s name without saving a hostPort for the container, and to not expose the container to the node’s namespace.

What my feature request solves:

My request is to have a different flag than hostNetwork: true that will allow a pod that is running on a node to know the node’s name (/etc/hostname). The reason that I would like my pod to know the hostname is to allow a Daemonset that I deploy to give me when using my app the data that I want to collect from the nodes and in addition the hostname.

Why I do not want to use hostNetwork flag ?

Because I do not want to be too intrusive by saving a hostPort for each of the pods of my daemonset.
When we are using this flag we are blocking the hostPort with the containerPort of the container which is blocking other deployments of the same daemonset that collect data from the nodes from other namespaces and use the same port (containerPort).

Cluster information:

Kubernetes version: 1.20
Installation method: kubeadm
Host OS: centos8
CNI and version: calico
CRI and version: docker

Why not just use value from field reference spec.nodeName. Are you not following some normal convention of using FQDN’s for your node names?

     - env:
        - name: MY_NODE_NAME
              fieldPath: spec.nodeName