refactor(chart): instances 数组改为 agents/edges 字符串数组,模板自动推导资源名

This commit is contained in:
ximenchuifeng committed 2026-06-30 08:27:25 +08:00
1 parent 7854605631
commit 4c031d7cf7
2 files changed
+43 -54

No files matched your search

+16 -40
View File
@@ -41,48 +41,24 @@ sharedInfra:
# 每个实例生成:后端 Deployment + 前端 Deployment + 独立 postgres StatefulSet
# 默认各 1 个,以后按需加(加一行 values + helm upgrade)
# ═══════════════════════════════════════════════════════════════
instances:
- name: agent-0
image: agent
role: agent
webName: agent-web-0 # 前端服务名(显式,因为命名不统一:agent-web-0 / ultra-web)
webImage: agent-web
# 注:webBasePath 不要带尾斜杠!Dockerfile 的 sed `s|/__BASE__|${VITE_BASE_PATH}|g`
# 配合 nginx.conf 的 `location /__BASE__/`(本身已带尾斜杠),再带尾斜杠会拼成
# /agent-0//(双斜杠)→ 浏览器 ERR_TOO_MANY_REDIRECTS 死循环。
# sso/ultra 不受影响(它们的 nginx.conf 用硬编码 /sso/,不走 __BASE__ 占位符)。
webBasePath: /agent-0
serviceId: agent-0
database: agent-db-0
pgStorage: 5Gi
description: "Agent 实例 0" # Gateway 中文展示名(mixingx.io/description annotation)
affinity: true # 前端和 DB 必须和后端同节点
# ═══════════════════════════════════════════════════════════════
# 点位配置 — 只写名字,模板自动推导其余字段
# 格式: agents/edges 为字符串数组,每个元素为点位后缀
# 生成规则:
# 后端: {role}-{site} 如 agent-0, agent-beijing
# 前端: {role}-web-{site} 如 agent-web-0, agent-web-beijing
# 数据库: {role}-db-{site} 如 agent-db-0, agent-db-beijing
# basePath: /{role}-{site} 如 /agent-0, /agent-beijing
# ═══════════════════════════════════════════════════════════════
- name: edge-0
image: edge
role: edge
webName: edge-web-0
webImage: edge-web
webBasePath: /edge-0 # 不带尾斜杠(同上,见 agent-0 注释)
serviceId: edge-0
database: edge-db-0
pgStorage: 5Gi
description: "Edge 实例 0"
affinity: true
agents:
- "0"
# - beijing
# - shanghai
# 加点位示例(取消注释 + helm upgrade 即生效):
# 注意:webBasePath 不能带尾斜杠,否则 Dockerfile sed 拼出双斜杠 → 重定向死循环
# - name: agent-beijing
# image: agent
# role: agent
# webName: agent-web-beijing
# webImage: agent-web
# webBasePath: /agent-beijing
# serviceId: agent-beijing
# database: agent-db-beijing
# pgStorage: 5Gi
# description: "北京厂区 注塑车间"
# affinity: true
edges:
- "0"
# - guangzhou
# ═══════════════════════════════════════════════════════════════
# 类型 B:独立不亲和(sso/ultra)— 后端+前端+独立DB,无亲和,多副本