【GLCC】Higress Console 支持 Gateway API-功能模块3 #356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
本pr主要完成功能第3部分和第4部分:首先是路由->httproute的转化,包括①httproute资源的 增删查改列 操作,②适配了重写、重定向等策略,③适配了wasm插件;以及单元测试:验证了配置转换逻辑,覆盖率92%
Ⅱ. 整体进度
[√]启动console时,初始化gtw class,读取网关模式
[√]修改域名定义,支持不同端口配置不同证书
[√]增加域名端口时,同时修改higress-gateway的service的ports字段 #896
[√]重写、重定向等策略的适配
[√]域名级插件适配
[√]路由级插件适配
[ ]支持openapi导入时指定域名级或路由级插件
Ⅲ. 结果
①路由创建
由于选择的
service
与httproute
不在一个ns中,会自动创建referencegrant
测试是否匹配到对应服务上
查看httproute状态:
②路由更新
添加请求头和请求参数
测试不同情况
查看httproute中rule:
③wasm插件适配
配置
自定义应答插件
请求结果:
④删除路由
可以看到对应插件也已经删除
Ⅳ. 备注
目前
Route
中有些注解httproute
cr中并未有对应的参数进行转换,因此我先在httproute中直接添加相应注解,如下表所示KubernetesConstants.Annotation.IGNORE_PATH_CASE_KEY
Route.path.caseSensitive
KubernetesConstants.Annotation.CORS_EXPOSE_HEADERS_KEY
Route.CORS
KubernetesConstants.Annotation.PROXY_NEXT_UPSTREAM_ENABLED_KEY
Route.proxyNextUpstream
KubernetesConstants.Annotation.SSL_REDIRECT_KEY
Domain.EnableHttps
https
route.CustomConfigs