v0.4.0¶
本次更新着重提升了Slime framework项目作为框架层的扩展能力,以及和各个模块之间的解耦, 以下分章节介绍本次变更的具体内容。
DATE: 20220323
framework¶
新功能¶
- 支持快速生成slime新的模块项目,新项目中可以是单个模块,也可以是多个模块聚合,详见 Add scripts for new module or bundle init #128
1.支持快速生成单个模块的项目
cd bin
bash gen_module.sh my_module
2.支持快速生成包含多模块的项目
cd bin
bash gen_bundle.sh my_bundle lazyload limiter
把新项目变成git项目,第一次提交后,你就可以构建镜像了。
-
支持自定义启动参数和环境变量,详见 Support custom args and env for module #133
-
支持给模块添加自定义API接口,详见 Support for adding custom http handlers in module level #134
使用样例:
只要在lazyload的InitManager
函数中添加自定义http handler,如下所示,就可以得到一个新的api接口/lazyload/xxx
。
func (mo *Module) InitManager(mgr manager.Manager, env bootstrap.Environment, cbs module.InitCallbacks) error {
// register custom api interface
env.HttpPathHandler.Handle("xxx", livezHandler())
// ...
return nil
}
func livezHandler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if _, err := w.Write([]byte("Healthy!")); err != nil {
log.Errorf("livez probe error, %+v", err)
}
})
}
- 新增
kind
字段,模块名字可以是任意值,从而支持单模块多revision聚合打包,即以一个deployment运行多个不同revision的模块,详见 Module name and kind decoupling #140
现在你可以选择任意Slime模块聚合成一个项目,生成镜像,以一个Deployment形式运行!这大大简化了使用多个Slime模块时的部署维护难度。
除此以外,framework还支持同一个模块选择多次,配置不同的Revision,以处理不同类别的网络资源,就像Istio Revision所做的那样。
工程增强¶
- 模块独有的helm文件拆分到各个模块项目中,详见 Split helm templates accroding to modules #127
- 支持打多架构镜像,详见 support singel build and multiarch build #136
- 将模块专用配置从框架层解耦,详见 Support getting module config from slimeboot general field #137
- 模块配置支持yaml格式,详见 Support yaml format module config #141
lazyload 变更¶
新功能¶
- 支持自定义sidecar cr的workloadSelector,详见 Support for customization workloadSelector of sidecar #33 Support customizing workloadSelector through fence.Spec.workloadSelector.Labels #35
- 支持开关ServiceFence的自动创建功能,详见 Support for disable ServiceFence auto generating #36
工程增强¶
- 实现动态服务依赖关系持久化,详见 Make dynamic service dependency info durable #37
- 完成懒加载配置项从Slime框架层迁移至本项目,详见 Complete fence module config migration #39
- Prometheus metric模式支持Istio 1.12+版本,详见 Support prometheus as lazyload metric source in istio 1.12+ #42
limiter 变更¶
新功能¶
- 支持对所有端口入流量侧添加限流规则,详见 Support any port #21
- 支持开关全局均分限流功能,详见 Support disable global average rate limit #22
- 支持开关全局共享限流功能,详见 Support disable global shared rate limit #22
工程增强¶
- 修复Envoyfilter转换问题,详见 Fix headerMatch and refresh problem #16
- Envoyfilter转换兼容老版本istio,详见 Compatible problem,use typeurl #20
- 适配新版本slime metric,详见 Adapter new metric framework #22
- 完成模块配置项从Slime框架层迁移至本项目,详见 Move limiter module config from framework to module #23
plugin 变更¶
新功能¶
- EnvoyPlugin支持
ListenerType
,详见 EnvoyPlugin supports ListenerType and fix FromJSONMap wrong proto type url #9 - PluginManager支持
listener port
匹配,详见 PluginManager and EnvoyPlugin match enhance #10 - EnvoyPlugin支持自定义
gateway handler
,详见 PluginManager and EnvoyPlugin match enhance #10
工程增强¶
-
完成插件模块配置项从Slime框架层迁移至本项目,详见 Move plugin module config from framework to module #11
-
Envoyfilter patchContext
支持gaterway
类型,详见 Envoyfilter patchContext supports gateway #13 - 修复enable字段不生效问题,详见 Fix plugin enable field not effective error #14
- 更新slime版本至v0.4.0,详见 Update slime version to v0.4.0 #15