目前使用的版本为rancher 2.6.x
使用下面的配置部署后,发现并未生效,vxlan使用的端口仍然为8472,
network:
plugin: canal
options:
canal_iface: eth1
canal_flannel_backend_type: vxlan
# must be 4789 if using Flannel VxLan mode in the cluster with Windows nodes
canal_flannel_backend_port: “8872”
配置参考:
committed 01:50AM - 10 Nov 20 UTC
Sometimes the default 8472/udp port will conflict with virtualization platform, … and we need to change it, while the doc doesn't mention that.
目前新版的文档里并未提到如何修改vxlan端口:
是新版本语法有变动吗?谢谢
的确最早是支持这个配置的,但是应该失效有一段时间了。
如果你想临时方案,可修改kube-system下的configmap canal-config中的 net-conf.json
对应的value:
{
"Network": "10.42.0.0/16",
"Backend": {
"Type": "vxlan",
"Port": 7777
}
}
其中 Port 就是 vxlan的端口。修改后,redeploy一下canal daemonset即可。
然而,由于RKE的原子性,一旦触发类似rke update的操作,这里的配置可能会被回滚。
Flannel的net-conf配置其实非常复杂,很难在RKE中一一映射,参考:flannel/configuration.md at master · flannel-io/flannel · GitHub
如果期望能够自定义Canal(Calico+Flannel),最好设置RKE network为none,通过addon进行安装,这样确保可以按照自己的定制参数部署。参考:
至于,为什么早期支持该参数而现在又被移除掉?这个问题,我需要找找历史记录,可能过于久远。
如果确实是维护时出现了遗漏,我们会想办法加回来。