chore(chart): 移除废弃的单体主 chart,仅保留 release-charts
- 删除根 Chart.yaml/values.yaml/values-105.yaml 和 templates/(19 文件) - 这些单体 chart 是早期"替代 Aspire publish"的尝试,已被 release-charts/ 取代 - CI(.drone.yml)和 ArgoCD(mixingx-deploy)均只使用 release-charts/ - release-charts 有独立 _helpers.tpl,不依赖主 chart 的任何模板 - README 改写为只描述 release-charts 部署入口
This commit is contained in:
1 parent
7d6a034392
commit
38907081ab
20 files changed
+23
-1337
No files matched your search
@@ -1,107 +1,42 @@
|
||||
# MixingX.Hub.Chart
|
||||
|
||||
> Legacy note: repository root is the historical all-in-one chart. Keep it for compatibility while new GitOps releases migrate to the split charts under `release-charts/`.
|
||||
本仓库以 git submodule 形式挂载在 [mixingx.hub](https://gitee.com/mixing-tech/mixingx.hub) 的 `mixingx-chart/` 路径下。CI(Drone)和 ArgoCD 都通过 `release-charts/` 子目录访问,改路径名会破坏部署链路。
|
||||
|
||||
## Recommended Split Charts
|
||||
## 拆分 Release Charts(唯一部署入口)
|
||||
|
||||
Use these charts for new Argo CD Applications:
|
||||
所有部署(CI lint/template、ArgoCD Application)都使用 `release-charts/` 下的拆分 unit chart,不再有单体主 chart:
|
||||
|
||||
- `release-charts/mixingx-platform` - central platform services.
|
||||
- `release-charts/mixingx-edge-unit` - one edge unit per Helm release.
|
||||
- `release-charts/mixingx-agent-unit` - one agent unit per Helm release.
|
||||
| Chart | 职责 |
|
||||
|---|---|
|
||||
| `release-charts/mixingx-infra` | 共享基础设施(redis/mongo/rabbitmq/postgres) |
|
||||
| `release-charts/mixingx-platform` | 中央平台服务(sso/ultra/audit/gateway) |
|
||||
| `release-charts/mixingx-edge-unit` | 单个 Edge 单元(后端+前端+独立 DB+NanoMQ broker) |
|
||||
| `release-charts/mixingx-agent-unit` | 单个 Agent 单元(后端+前端+独立 DB) |
|
||||
| `release-charts/mixingx-gateway` | Gateway(带 MQTT broker 发现 RBAC) |
|
||||
| `release-charts/mixingx-sso` | SSO(独立发布) |
|
||||
| `release-charts/mixingx-ultra` | Ultra(独立发布) |
|
||||
| `release-charts/mixingx-audit` | Audit(独立发布) |
|
||||
| `release-charts/mixingx-protocol-server-unit` | 协议模拟器单元 |
|
||||
|
||||
The root chart remains available for old CI/manual Helm flows, but new deployments should prefer the split release boundary so platform upgrades do not prune customer-added edge/agent units.
|
||||
|
||||
MixingX 全栈部署 Helm Chart(替代 Aspire publish 生成器)。
|
||||
|
||||
- **name**: `mixingx`
|
||||
- **version**: 1.2.0
|
||||
- **appVersion**: 1.0.1
|
||||
|
||||
本仓库以 git submodule 形式挂载在 [mixingx.hub](https://gitee.com/mixing-tech/mixingx.hub) 的 `mixingx-chart/` 路径下。CI(Drone)和本地 `helm` 命令都通过这个路径访问,改路径名会破坏部署链路。
|
||||
|
||||
## 架构:4 种服务类型
|
||||
|
||||
| 类型 | 服务 | 特点 | 数据源 |
|
||||
|---|---|---|---|
|
||||
| **A 四胞胎** | agent / edge | 后端+前端+独立DB,podAffinity 强制同节点 | `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`。
|
||||
|
||||
## 三层调度优先级
|
||||
|
||||
每个 Pod 的 `spec` 按以下优先级**只取一层**:
|
||||
|
||||
```
|
||||
1. nodeName 直接指定节点(最高,跳过 scheduler)
|
||||
2. pointAffinity 点位级 nodeAffinity(覆盖全局 tier)
|
||||
3. tier 全局档位调度(tier.enabled=true 才生效)
|
||||
4. 无 兜底,随便调度
|
||||
```
|
||||
|
||||
- **nodeName**:点位对象 `{site, nodeName}` → 跳过 scheduler。⚠️ 配合 local-path WaitForFirstConsumer 会触发 PVC 死循环(k8s#89953),生产建议用 nodeAffinity+label。
|
||||
- **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 变体)。
|
||||
|
||||
## 模板结构
|
||||
|
||||
```
|
||||
templates/
|
||||
├── _helpers.tpl # 镜像名/标签/服务发现标签
|
||||
├── _backend.tpl # 后端三件套(Deployment+Service+ConfigMap+Secret)
|
||||
├── _frontend.tpl # 前端两件套(Deployment+Service)
|
||||
├── _postgres.tpl # 独立 PG(StatefulSet+Service+PVC)
|
||||
├── _tier-affinity.tpl # 全局 tier 调度(最底层)
|
||||
├── _point-affinity.tpl # 点位 nodeAffinity(中层)
|
||||
├── instances.yaml # 🔁 遍历 agents/edges → 调用三个公共模板
|
||||
├── standalones.yaml # 🔁 遍历 standalones(sso/ultra)
|
||||
├── backend-gateway.yaml # gateway(单例,带 RBAC)
|
||||
├── audit.yaml # audit(独立模板,连 Mongo)
|
||||
├── shared-infra.yaml # 🔁 redis/mongo/rabbitmq
|
||||
├── mock.yaml # 🔁 协议模拟器
|
||||
├── dashboard.yaml # Aspire OTLP Dashboard
|
||||
├── pgadmin.yaml # pgAdmin + 独立 Ingress
|
||||
├── app-ingress.yaml # 业务总 Ingress(→ gateway)
|
||||
└── gateway-rbac.yaml # gateway SA + Role + RoleBinding
|
||||
```
|
||||
每个 chart 独立 `helm release`,平台升级不会误删客户自加的 edge/agent 单元。
|
||||
|
||||
## 使用
|
||||
|
||||
### 打包发布
|
||||
### CI(Drone)lint + template
|
||||
|
||||
CI 只对 `release-charts/` 做 lint/template(见 hub `.drone.yml`):
|
||||
|
||||
```bash
|
||||
helm package . --version 1.2.0 # 生成 mixingx-1.2.0.tgz
|
||||
# 上传到 kube-node 工具的 /charts 页(agents/edges 新格式门禁)
|
||||
helm lint release-charts/mixingx-edge-unit
|
||||
helm template ci-edge release-charts/mixingx-edge-unit
|
||||
```
|
||||
|
||||
### 部署(Drone CI 链路)
|
||||
### ArgoCD 部署
|
||||
|
||||
CI 用相对路径 `./mixingx-chart`(submodule 同名),values 覆盖用 `values-105.yaml`:
|
||||
|
||||
```bash
|
||||
helm upgrade --install production ./mixingx-chart \
|
||||
-f mixingx-chart/values-105.yaml \
|
||||
--set tag=<镜像tag> \
|
||||
--kube-context ctx-105 --namespace mixingx --create-namespace
|
||||
```
|
||||
|
||||
### 验证渲染
|
||||
|
||||
```bash
|
||||
helm lint .
|
||||
helm template test . | grep -E "^kind:" | sort | uniq -c
|
||||
# 默认:23 Service / 16 Deployment / 7 StatefulSet / 5 Secret / 5 ConfigMap / 2 Ingress + SA/Role/RoleBinding
|
||||
```
|
||||
`mixingx-deploy` 的 ApplicationSet 按 unit chart 逐个发布,每个 edge/agent 一个独立 Helm release。详见 `mixingx-deploy/`。
|
||||
|
||||
## 关联文档
|
||||
|
||||
部署链路、kube-node 工具、tier 设计详见 hub 仓库:
|
||||
|
||||
- hub [AGENTS.md](https://gitee.com/mixing-tech/mixingx.hub) — 全项目指南
|
||||
- `mixingx-deploy/` — ArgoCD Application + 环境 values
|
||||
- `docs/superpowers/specs/2026-07-01-node-tier-affinity-design.md` — 三层调度设计
|
||||
- `docs/superpowers/specs/2026-07-01-node-tier-affinity-playbook.md` — 操作手册(流程图+场景速查)
|
||||
Reference in new issue
Block a user