nokia / danm

TelCo grade network management in a Kubernetes cluster
BSD 3-Clause "New" or "Revised" License
373 stars 81 forks source link

Support for NodePort service on secondary POD interfaces #261

Closed lsoica closed 3 years ago

lsoica commented 3 years ago

Hi,

I am trying to setup two k8s clusters where pods are attached on two different networks. One for intra-cluster communication and another one for inter-cluster communication and for accessing the pods from the outside world.

The only option I have for making services externally accessible is through NodePort, like in this diagram:

image

The question is, can I have NodePort services on POD interfaces other than default one ?

Levovar commented 3 years ago

no but your assumption that your secondary network interface also needs to be NATted is not true. use IPVLAN/MACVLAN/SR-IOV CNI to directly provision the external IP to the secondary interface of your Pod, thus achieving direct connectivity without a need for NAT

lsoica commented 3 years ago

Thanks for the confirmation.

The reason behind NodePort requirement is because I only have one IP per k8s node per network. I assume this does not work with IPVLAN/MACVLAN, right ?

Levovar commented 3 years ago

no, not really. NATting all your Pod IPs to external NodEIPs is already not best practice TBH

in any case, this has not much to do with DANM so closing the issue