How can one attach two network interfaces to a single pod in kubernetes?

9/27/2019

I want two different ethernet interfaces on my application pod. Is there any possible way to achieve this in kubernetes?

-- Rahil Jaiswal
kubernetes
kubernetes-pod
microservices

1 Answer

9/30/2019

As per Kubernetes documentation each pod have unique IP address.

Each Pod is assigned a unique IP address. Every container in a Pod shares the network namespace, including the IP address and network ports. Containers inside a Pod can communicate with one another using localhost. When containers in a Pod communicate with entities outside the Pod, they must coordinate how they use the shared network resources (such as ports).

However, during searching information about multiple pod interfaces I found that Multus should be able to do what you need.

Multus is a Multi CNI plugin to support the Multi Networking feature in Kubernetes using CRD based network objects in Kubernetes.

There is more information about this plugin in Github.

Multus CNI is a container network interface (CNI) plugin for Kubernetes that enables attaching multiple network interfaces to pods.

You can also find some multus examples for macvlan or flannel.

Hope it will help.

-- PjoterS
Source: StackOverflow