Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【GLCC】Higress Console 支持 Gateway API-功能模块3 #356

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

iendi
Copy link

@iendi iendi commented Oct 16, 2024

Ⅰ. Describe what this PR did

本pr主要完成功能第3部分和第4部分:首先是路由->httproute的转化,包括①httproute资源的 增删查改列 操作,②适配了重写、重定向等策略,③适配了wasm插件;以及单元测试:验证了配置转换逻辑,覆盖率92%

Ⅱ. 整体进度

功能 进度 任务
资源定义及初始化 ✅已完成 [√]CRD Model的创建(gatewayclass, gateway, httproute, refrencegrant)
[√]启动console时,初始化gtw class,读取网关模式
域名->gateway ✅已完成 [√]gateway资源的 增删查改列 操作
[√]修改域名定义,支持不同端口配置不同证书
[√]增加域名端口时,同时修改higress-gateway的service的ports字段 #896
路由->httproute ✅已完成 [√ ]httproute资源的 增删查改列 操作
[√]重写、重定向等策略的适配
[√]域名级插件适配
[√]路由级插件适配
单元测试 ✅已完成 [√]验证配置转换逻辑的单元测试用例,覆盖率不低于 80%
openapi导入 🔄进行中 [ ]支持openapi导入,生成对应的domain和route
[ ]支持openapi导入时指定域名级或路由级插件

Ⅲ. 结果

①路由创建

image

image
由于选择的servicehttproute不在一个ns中,会自动创建referencegrant

image
测试是否匹配到对应服务上

image
查看httproute状态:

image
②路由更新

添加请求头和请求参数

image
测试不同情况

image
查看httproute中rule:

image

③wasm插件适配

配置自定义应答插件

image
请求结果:

image
④删除路由

image
可以看到对应插件也已经删除

image

Ⅳ. 备注

目前Route中有些注解httproute cr中并未有对应的参数进行转换,因此我先在httproute中直接添加相应注解,如下表所示

annotation model 功能
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 自定义配置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant