<p>How do I be able to go to a specific Pod in a DaemonSet without hostNetwork? The reason is my Pods in the DaemonSet are stateful, and I prefer to have at most one worker on each Node (that's why I used DaemonSet). </p>

<p>My original implementation was to use hostNetwork so the worker Pods can be found by Node IP by outside clients. But in many production environment hostNetwork is disabled, so we have to create one NodePort service for each Pod of the DaemonSet. This is not flexible and obviously cannot work in the long run.</p>

<p><strong>Some more background on how my application is stateful</strong></p>

<p>The application works in an HDFS-taste, where Workers(datanodes) register with Masters(namenodes) with their hostname. The masters and outside clients need to go to a specific worker for what it's hosting.</p>

OrlandoL
<p><code>hostNetwork</code> is an optional setting and is not necessary. You can connect to your pods without specifying it. 
To communicate with pods in DaemonSet you can specify <code>hostPort</code> in the DaemonSet’s pod spec to expose it on the node. You can then communicate with it directly by using the IP of the node it is running on.</p>

<p>Another approach to connect to stateful application is <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet</a>. It allows you to specify network identifiers. However it requires <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="nofollow noreferrer">headless service</a> for network identity of the Pods and you are responsible for creating such services.</p>
