Hacker News new | ask | show | jobs
by buzer 3271 days ago
Regarding the first article, strictly speaking it isn't necessary to use hostNetwork, but to actually do it in standard public cloud environment isn't really possible.

Normally it's good idea to avoid hostNetwork as it creates quite a bit of limitations. For example, you cannot use network security policies and you cannot use deployments to assign more than 1 pod per node. To allow same application to run multiple instances on same node, you would need to create multiple deployments with different ports.

To avoid hostNetwork, essentially what is required is that you need publicly routable addresses for each pod (1:1 NAT is also possible, but it's quite a bit more complicated, e.g. you probably need create custom ingress controller which creates the 1:1 NAT mappings) which is also the reason why this doesn't really work in public cloud environments. If you can accomplish that though, you get to use all of Kubernetes' standard features on your pods.

tl;dr NAT sucks