<p>Can you simply summarize what the following two definitions do and when they should be used?</p>
<p><code>spec: hostNetwork: true dnsPolicy: ClusterFirstWithHostNet</code></p>
<p>I do not have enough knowledge about networking in Kubernetest and the articles I found are not understandable to me.</p>

Melek
<p>You should probably never use either option.</p>
<p><code>hostNetwork: true</code> disables Kubernetes's networking layer entirely.  If your code tried to do things like enumerate network interfaces, it'd see the current node's network, not the Kubernetes-internal network.  This will result in you having trouble doing things like calling out to other Services.  You'd have to be in a very unusual setup to want this.</p>
<p>(I see host networking used in a plain-Docker context sometimes, for example as a hack to get around a hard-coded <code>localhost</code> name.  This is less likely to work in Kubernetes since you'll typically have multiple nodes, and the database container might not be on the same node as the application.)</p>
<p>The <code>dnsPolicy:</code> you mention seems to be specific to activating host networking.  Again, you shouldn't need to manually configure <code>dnsPolicy:</code>.  The standard setting of <code>dnsPolicy: ClusterFirst</code> is right for almost all scenarios.</p>
