feat(edge-unit): 去 PostgreSQL + Edge Secret 只读挂载 + data PVC

This commit is contained in:
ximenchuifeng committed 2026-07-30 18:45:53 +08:00
1 parent 08ed1422fe
commit 5d51b2e1de
9 files changed
+115 -104

No files matched your search

+4 -4
View File
@@ -24,12 +24,12 @@ MixingX 全栈部署 Helm Chart(替代 Aspire publish 生成器)。
| 类型 | 服务 | 特点 | 数据源 |
|---|---|---|---|
| **A 四胞胎** | agent / edge | 后端+前端+独立DB,podAffinity 强制同节点 | `agents` / `edges` 数组 |
| **A 点位单元** | agent / edge | Agent 为后端+前端+独立DB;Edge 为后端+前端+本地修订存储 | `agents` / `edges` 数组 |
| **B standalones** | sso / ultra | 后端+前端+独立DB,无亲和,多副本 | `standalones` 数组 |
| **C 无DB** | gateway / audit | 单后端(gateway 带 RBAC;audit 连 Mongo) | `gateway` / `audit` 块 |
| **D 共享基础设施** | redis / mongo / rabbitmq | StatefulSet+PVC,所有服务共用 | `sharedDatastores` 数组 |
每个有 DB 的服务各自独立 postgres(StatefulSet),连接串指向 `{name}-postgres-service`。
Agent、SSO、Ultra 各自使用独立 PostgreSQL。Edge 不生成 PostgreSQL workload、Service、Secret、连接串或数据库 PVC。
## 三层调度优先级
@@ -46,7 +46,7 @@ MixingX 全栈部署 Helm Chart(替代 Aspire publish 生成器)。
- **pointAffinity**:点位对象 `{site, nodeAffinity: {required?, preferred?}}` → 原生 nodeAffinity,由 kube-node OpsPage 点位对话框编辑。
- **tier**:给节点打 `mixingx.io/tier=infra|perf|edge` label,服务按角色声明要去哪档(`required` 硬约束 / `preferred` 软约束)。
前端/PG 因要和后端 podAffinity 同节点,合并 podAffinity + nodeAffinity 到同一个 `affinity:` 块(见 `_tier-affinity.tpl` / `_point-affinity.tpl` 的 NodeAffinity 变体)。
前端以及需要数据库的服务 PG 与后端使用 podAffinity;Edge 只有前端与后端需要同节点调度。
## 模板结构
@@ -58,7 +58,7 @@ templates/
├── _postgres.tpl # 独立 PG(StatefulSet+Service+PVC)
├── _tier-affinity.tpl # 全局 tier 调度(最底层)
├── _point-affinity.tpl # 点位 nodeAffinity(中层)
├── instances.yaml # 🔁 遍历 agents/edges → 调用三个公共模板
├── instances.yaml # 🔁 遍历 agents/edges;仅 Agent 调用 PostgreSQL 模板
├── standalones.yaml # 🔁 遍历 standalones(sso/ultra)
├── backend-gateway.yaml # gateway(单例,带 RBAC)
├── audit.yaml # audit(独立模板,连 Mongo)