Add multiple network interfaces inside a pod in Kubernetes

I’m trying to add a second network interface in Docker containers (with only Docker, I simply add my container to another “docker network” using the docker network command) in Kubernetes such that containers are also able to communicate together through this second interface.

The thing is that it is not possible to simply call the docker network command. I get the following error: Container sharing network namespace with another container or host cannot be connected to any other network.

  • Remotely create a vhost on a docker container running rabbitmq
  • Yum install / update not working inside docker images but working otherwise from the centos machine
  • Is the 'local' vm required once the swarm cluster has been deployed?
  • Mule 3.7 insufficient memory for JVM
  • Docker-compose scale up Jetty with NGINX at runtime
  • Is Tensorflow/Docker Useful for Development, or just demo/tests?
  • This error seems logic to me as the network is not managed the same way with Kubernetes (all containers in a pod share their IP if I understood correctly). But now the question is: how can I add a second network interface easily to my container (or to my pod)?

    I did some research and I found that Kubernetes is able to use CNI and that it could be my solution. But I was unable to have it working (don’t know if the error is on my side or because everything is continuously evolving). I also searched for other solutions in the Kubernetes documentation, but I don’t know if one of them can make me happy in an easy way 🙂

    Thanks for your help!

    P.S.: For a bit more context, I am creating containers with an application that needs to have two working interfaces (I cannot modify this application to use only one NIC) and I’m trying to have it working on my laptop (local Kubernetes/Docker installation) without needing replication on multiple nodes.

  • How can I output all except the first character of a Go template key or field?
  • How should I set up debian installation of docker to accept remote connections
  • Dynamically set JAVA_HOME of docker container
  • Destination location when using ADD command if <dest> is not provided
  • Docker exit status 1 for Node app on AWS
  • How to setup a docker swarm cluster with AWS ubuntu machine [closed]
  • One Solution collect form web for “Add multiple network interfaces inside a pod in Kubernetes”

    This is probably not going to be available by Kubernetes since network is not a first class object. It makes more sense for your application to work off of a single interface.

    Another option is for you to manage your own network namespace and keep this container(s) out of the scope of Kubernetes. So all the network plugging will have to be done by you including scheduling of this.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.