-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default vpc eip and snat conflict with kube-ovn multus nic #3126
Comments
你是期望一定要使用 annotation 这种方式来管理 多网卡pod的不同vpc subnet 网卡都能使用 eip 或者 snat 么? |
ovn-fip 这种怎么配置,文档中没看到这块了 |
看到了,这个要kube-ovn v1.12版本才支持吧,看到这个版本的doc有文档记录 |
是的 |
我搭环境如下: 准备 provider-network, vlan, subnetcat 01-provider-network.yamlapiVersion: kubeovn.io/v1 cat 02-vlan.yamlapiVersion: kubeovn.io/v1 cat 03-vlan-subnet.yamlapiVersion: kubeovn.io/v1
启用默认 vpc 和上述 underlay 公网 provider subnet 互联#cat 00-centralized-external-gw-no-ip.yamlapiVersion: v1 root@master1:/home/mep/ovneip#
|
ovn nat 残留问题基于该PR修复: #3139 在默认vpc下,我没有复现ovn-fip 创建后不通的情况,而且环境需要准备两张网卡,一张给vpc网络,另一张给provider-network。建议再对照下文档。 已回合 release1.12 |
我是2张网卡了,在三台kvm虚拟机上。宿主机上创建了2个nat网络 192.168.122.0/24,和172.56.0.0/24,给3台虚拟机每台2张网卡,分别属于2个nat网络。这样的环境有问题吗? 你先测试下单张网卡 配 ovn-fip 是否能通,或者主网卡配 ovn-fip是否能通,一张网卡单独测试是否能通 |
我这环境的网络表现的越来越奇怪了,对默认vpc下的pod IP设置ovn fip,只有pod所在节点才能ping通 ovn fip,其他节点不能ping通。tcpdump抓icmp包,有request和reply 报文,但是ping命令就是卡住,不显示 |
你可以先测试下自定义vpc下的 单网卡 pod 的 ovn fip 跨节点是否可以 ping 通 |
Issues go stale after 60d of inactivity. Please comment or re-open the issue if you are still interested in getting this issue fixed. |
Feature request
使用kube-ovn的默认vpc下的多子网,给pod设置多个子网的网卡。同时想支持指定网卡的 eip地址设置。
Use case
在实际使用过程中,我给pod默认vpc下的默认子网,以及按照kube-ovn多网卡配置,创建一个子网kubeovnnet。创建pod同时使用2个子网的网卡,并且设置其中一个子网的eip,注解如下
annotations:
ovn.kubernetes.io/ip_address: 10.233.64.59
ovn.kubernetes.io/mac_address: 00:00:00:53:6B:B7
ovn.kubernetes.io/default_route: 'true'
kubeovnnet.default.ovn.kubernetes.io/logical_switch: kubeovnnet
kubeovnnet.default.ovn.kubernetes.io/allow_live_migration: 'true'
kubeovnnet.default.ovn.kubernetes.io/ip_address: 172.57.0.19
kubeovnnet.default.ovn.kubernetes.io/mac_address: '00:00:11:53:6B:B7'
ovn.kubernetes.io/eip: 192.168.122.51
在pod的创建过程中,报错如下
I0809 11:41:46.793874 6 pod.go:476] handle update pod default/virt-launcher-vm-u1804-q95rd
I0809 11:41:46.794048 6 pod.go:935] update pod default/virt-launcher-vm-u1804-q95rd
I0809 11:41:46.794068 6 network_attachment.go:66] parsePodNetworkAnnotation: [{"interface":"podfff8ab36656","mac":"00:00:00:53:6B:B6","name":"kubeovnnet","namespace":"default"}], default
W0809 11:41:46.857073 6 ovn-nbctl-legacy.go:53] ovn-nbctl command error: ovn-nbctl --timeout=60 --no-wait --may-exist lr-nat-add ovn-cluster dnat_and_snat 192.168.122.51 10.233.64.59 in 4ms
E0809 11:41:46.857150 6 pod.go:1040] failed to add nat rules, ovn-nbctl: a NAT with this type (dnat_and_snat) and external_ip (192.168.122.51) already exists
, "exit status 1"
E0809 11:41:46.857220 6 pod.go:488] error syncing 'default/virt-launcher-vm-u1804-q95rd': ovn-nbctl: a NAT with this type (dnat_and_snat) and external_ip (192.168.122.51) already exists
, "exit status 1", requeuing
查看源码pkg/controller/pod.go发现handleUpdatePod方法中有以下循环
for _, podNet := range podNets {
if !isOvnSubnet(podNet.Subnet) {
continue
}
.......
if c.config.EnableEipSnat {
for _, ipStr := range strings.Split(podIP, ",") {
if err := c.ovnLegacyClient.UpdateNatRule("dnat_and_snat", ipStr, pod.Annotations[util.EipAnnotation], c.config.ClusterRouter, pod.Annotations[util.MacAddressAnnotation], fmt.Sprintf("%s.%s", podName, pod.Namespace)); err != nil {
klog.Errorf("failed to add nat rules, %v", err)
return err
}
......
会针对pod每一kube-ovn管理的网路,处理eip和snat规则。因为eip/snat注解名称固定的只能分配一个IP,到解析第二个网路就会报错,因为外部 IP以及被第一个网络使用了。 希望扩展eip snat 注解名称,让它与指定的kube-ovn网络绑定。由名称去判断哪个网络做eip 和snat。也支持配置多个网络的eip和snat。
The text was updated successfully, but these errors were encountered: