Skip to content

feat(helm): support cloud ingress deployment#980

Open
likes1234-bro wants to merge 1 commit intoiflytek:mainfrom
likes1234-bro:fix_helm
Open

feat(helm): support cloud ingress deployment#980
likes1234-bro wants to merge 1 commit intoiflytek:mainfrom
likes1234-bro:fix_helm

Conversation

@likes1234-bro
Copy link
Copy Markdown
Contributor

概述

本次 PR 对 Helm Chart 进行了云环境部署相关改造,使基于 Ingress 的部署路径可以在云上 Kubernetes 环境中正常使用。

变更内容

  • 新增 gateway nginx 组件,作为统一入口层
  • 通过 gateway 统一转发前端、console 后端、Casdoor 和 workflow 请求
  • 修复 Casdoor 回调地址和公网访问地址生成逻辑
  • 修复 Casdoor 登录页静态资源路由问题
  • 新增阿里云 ACK 和华为云 CCE 的独立 values 配置文件
  • 将云环境默认部署方式调整为 Ingress + ClusterIP
  • 为 core-database 补充 Redis 环境变量,修复启动失败问题

验证情况

  • 使用 values-aliyun.yaml 执行 helm lint
  • 使用 values-huaweicloud.yaml 执行 helm lint
  • 使用 values-aliyun.yaml 执行 helm template
  • 使用 values-huaweicloud.yaml 执行 helm template
  • 已在阿里云 ACK 上验证部署流程
  • 已在华为云 CCE 上验证部署流程

说明

  • 用户在部署前仍需要填写自己的平台参数

可供参考的文档和模板下载链接

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


binfan5 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@likes1234-bro
Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 引入了 Gateway NGINX 作为统一入口,并重构了 Helm Chart 以支持云环境下的 Ingress 部署,这是一个很好的架构改进。通过抽离公共 URL 的生成逻辑到 _helpers.tpl,代码的可维护性得到了提升。新增的 values-aliyun.yamlvalues-huaweicloud.yaml 也为不同云环境的部署提供了便利。

整体来看,代码质量很高。我只发现一个关于 oauth2JwkSetUri 配置的关键问题,它可能会在启用 TLS 的场景下导致认证失败和安全风险。请查看具体的审查意见。

value: {{ include "astron-agent.minio.publicUrl" $ | quote }}
{{- else if eq $key "oauth2JwkSetUri" }}
- name: {{ upper (snakecase $key) }}
value: {{ printf "http://%s:%d/.well-known/jwks" (include "astron-agent.casdoor.host" $) ($.Values.casdoor.service.port | int) | quote }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

OAUTH2_JWK_SET_URI 的值被硬编码为使用 http 协议和内部服务地址。然而,OAUTH2_ISSUER_URI 使用的是公共访问地址(可能为 https)。这会导致几个问题:

  1. 协议不匹配: 当 Ingress 启用 TLS 时,Issuer URI 是 https,但 JWKS URI 是 http。这可能会导致 JWT 验证器因协议不匹配而拒绝验证。
  2. 安全风险: 在生产环境中,通过非加密的 http 获取用于验证签名的公钥存在安全风险。
  3. 主机不匹配: 验证器可能还会校验 JWKS 的来源主机是否与 Issuer 声明中的主机一致,使用内部主机名 astron-agent-casdoor 会导致校验失败。

建议修改此处的逻辑,使用公共 URL 来构建 JWKS URI,以确保协议和主机名的一致性和安全性。Gateway NGINX 已经配置了对 /.well-known/ 路径的代理,因此使用公共地址是可行的。

          value: {{ printf "%s/.well-known/jwks" (include "astron-agent.casdoor.publicUrl" $) | quote }}

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.

2 participants