支持配置版本的flannel 服务

我已经介绍了一个修改版本的flannel (主要是0.7.1 版本的),当时是修改了一个固定版本,不方便
如果我们的节点需要运行更多的flannel 服务基于配置的就比较方便了

参考修改

核心是支持配置,通过配置解析以及进行参数传递
主要包含的文件main,go pkg/subnet/config.go pkg/backend/vxlan/vxlan.go,具体的git 提交

使用

可以直接通过替换rpm 的配置文件

 
# Flanneld configuration options  
 
# etcd url location.  Point this to the server where etcd runs
FLANNEL_ETCD_ENDPOINTS="http://127.0.0.1:2379"
 
# etcd config key.  This is the configuration key that flannel queries
# For address range assignment
FLANNEL_ETCD_PREFIX="/atomic.io/network"
 
# Any additional options that you want to pass 此处通过-vni 支持vxlan 的vni 
FLANNEL_OPTIONS="-vni=2  -subnet-file=/run/flannel/subnetv2.env"

说明

修改版本已经共享到gihtub 中了,对于需要使用的可以参考

参考资料

https://github.com/rongfengliang/flannel
https://github.com/rongfengliang/myflannel
https://github.com/flannel-io/flannel
https://github.com/rongfengliang/flannel/commit/5b3519601de5f910cce290380e997f8591c3b8e2

posted on 2023-02-07 22:33  荣锋亮  阅读(68)  评论(0编辑  收藏  举报

导航