kubernetes - 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.
解决方案
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.
推荐阅读
- ruby-on-rails - 无法运行任何 rake 任务...说“Rake 已中止!不知道如何构建任务'
- java - 为什么 HashSet 不能只在内部使用位数组而不是 HashMap 来节省一些空间?
- css - 如何更改 Shopify 'Brooklyn' 主题中支付图标的大小?
- javascript - 加载时自动检查三个单选按钮
- javascript - Puppeteer - 测试不执行任何操作
- javascript - 如何使用 wd 和 javascript 选择 Appium 中另一个元素的子元素?
- java - 在 Maven 3.6.0 中自动更新项目版本
- objective-c - 文件名的 NSArray 不会在 NSTableView 中加载
- java - 返回活动后的java.lang.OutOfMemoryError
- regex - 将两行合二为一的正则表达式?