Reputation: 45
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?
Upvotes: 2
Views: 12648
Reputation: 3427
You can create Services for pods on host network in the same way as Services for pods on pod network.
This is what I experienced in my Kubernetes cluster, and I did not see any documentation that explicitly states that Services will not work with pods on host network.
Upvotes: 0
Reputation: 44657
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.
Upvotes: 12