Search code examples
kuberneteshostnetwork

Are Kubernetes pods that use host networking assigned a pod IP that can be accessed using a Service resource?


If a Kubernetes pod is defined with host network enabled, is the application running on this pod accessible from the Service resource using the app selector?


Solution

  • Host network means it will use the host system's network. Services are created in pod network which is separate. So it can not be accessed that way. You can access a pod with host network directly using the IP of the host system. You should avoid using host network though for various reasons.

    Here is an article to understand it more deeply.