haproxy 新版本特性是比较都的,以下说明集中动态配置的方法
几种参考方法
- consul
官方支持基于consul 的服务发现 - dns
基于dns 的服务发现 - dataplane api
基于dataplan api 进行控制 - confd
confd 是一个很不错的方案 - ingress controller
基于ingress controller 解决 - 自己开发
可以基于golang 的conf api 开发一个agent 进行reload。比较类似百度bfe 的conf-agent
说明
以上是几种实现方法,方法还是比较多的,而且很多都是现成的可以直接使用,参考百度bfe 也是一个不错的方案,可以实现配置的数据持久化以及版本灵活管理
参考资料
https://github.com/haproxytech/dataplaneapi
https://github.com/haproxytech/config-parser
https://github.com/haproxytech/client-native
https://github.com/bfenetworks/api-server/blob/develop/docs/zh_cn/deploy.md#confagent%E9%83%A8%E7%BD%B2