首页 > 解决方案 > Kubernetes weave how to create pod with network that uses bridge as network?

问题描述

I am a beginner at using Kubernetes, so I don't fully understand how creating networks for pods works. How can I create pods on a node that can communicate with a an OVS bridge, say br0 using the weave plugin.

Is there any way I can create a network using the bridge itself or is there a way to forward traffic to that bridge.

I need to use the weave plugin so suggesting another wouldn't be useful to me. The whole idea for this is to create a service chain using an ovs bridge interface.

标签: kubernetesweave

解决方案


I found what I needed. Once you have created an OVS bridge on the node you can create a bridge and a new interface on a pod to it.

Using the following command you create the eth1 interface on the container you want bridged to the ovs-br0, change names of variable to suit your topology.

ovs-docker add-port ovs-br0 eth1 k8s_plex-server2_plex-server2_default_742f2aa2-57b6-4a92-8225-4fa25ff65705_0  --ipaddress=10.50.0.11/16
  • ovs-br0 - OVS bridge name
  • eth1 - interface you wish to create on container
  • k8s-plex-server2... - name of container you are using
  • ipaddress flag - used for immediately assigning the ip of the pod interface. You need to assign it to the ovs bridge IP address pool.

推荐阅读