Direct pod networking with Kubernetes

11/21/2018

I am trying to move a currently docker based app to Kubernetes. My app inspects network traffic that passes through it, and because of that it needs an accessible External IP, and it needs to accept traffic on all ports, not just some.

Right now, I am using docker with a macvlan network driver in order to attach docker containers to multiple interfaces and allow them to inspect traffic that way.

After research, I've found that the only way to access pods in Kubernetes is using Services, but services only allow that through some specific ports, because it is mostly intended for "server" type applications, and not "forwarder"/"sniffer" type which is what I am looking for.

Is Kubernetes a good fit for this type of application? Does it offer tools to cope with this problem?

-- Roy Cohen
kubernetes
networking

1 Answer

11/21/2018

Is Kubernetes a good fit for this type of application? Does it offer tools to cope with this problem?

Being a good fit is more of an opinion, the pods in Kubernetes have their own PodCidr that is not exposed to the outside world and a sniffer doesn't quite fit in either a service or a job definition which are the typical workloads in Kubernetes.

Having said, it can be done if you can use your custom CNI plugin that supports macvlan

You can also use something like Multus that supports the macvlan plugin.

-- Rico
Source: StackOverflow