How hostNetwork : true works with K8s Internal Services?

41 views
Skip to first unread message

Chase

unread,
Feb 3, 2018, 3:59:21 PM2/3/18
to Kubernetes user discussion and Q&A
Hello - I am trying to understand how "hostNetwork: true" works with internal pod communication.  For example, if I create a daemonSet with hostNetwork : true and ClusterFirstWithHostNet should this pod be able to :

1.  Bind to the host network 
2.  Communicate to services in the K8s network.

The reason I ask is that in Docker if you bind to the host network you cannot communicate over the overlay network to other services.   It seems from reading the hostNetwork: true should works to allow both host and internal K8s communication.  Any explanation here would be great.

Thanks
Chase

Matthias Rampke

unread,
Feb 5, 2018, 6:16:32 AM2/5/18
to kubernet...@googlegroups.com
Hey,

yes, I think this should work for any reasonable overlay. NodePorts are also implemented essentially in the host network namespace, so if this wouldn't work you would not have any way of getting traffic into the cluster at least as far as I can see.

Of course, the best way to find out for your particular environment is to try!

/MR

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Tim Hockin

unread,
Feb 6, 2018, 12:23:59 AM2/6/18
to Kubernetes user discussion and Q&A
Kubernetes does not demand an overlay, and most of the overlays used
for kube employ some form of node gateway to allow packets to cross
between planes.
Reply all
Reply to author
Forward
0 new messages