diff --git a/README.md b/README.md index 2bcaca2..ecb9323 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ Demo environment: 2. Apply or create `bootstrap/mixingx-demo-root.yaml`. 3. Argo CD will create/sync the applications under `applications/`. +Dev environment (retired): + +- The dev environment (namespace `mixingx-dev`, `dev.mixingx.local`) is retired; local development is covered by Aspire in `mixingx.hub`. +- Its manifests are kept inert under `applications/dev/disabled/` and `bootstrap/disabled/`; values under `environments/dev/` are kept for reference. +- See `applications/dev/README.md` for the rationale and re-enable steps. + Agent and edge fleets: - `applications/agents.yaml` is an Argo CD ApplicationSet. diff --git a/applications/dev/README.md b/applications/dev/README.md new file mode 100644 index 0000000..95c5c15 --- /dev/null +++ b/applications/dev/README.md @@ -0,0 +1,62 @@ +# Dev 环境(已退役) + +> 状态:自 2026-08-26 起退役。本目录仅保留历史配置与启用说明,Argo CD 不再同步 dev 环境。 + +## 为什么退役 + +- dev 环境的历史使命是验证 mixingx.deploy「分支 + 文件夹」GitOps 结构(master 分支 + `environments/`、`applications/` 按环境分目录)是否可行。该结构已被 demo 环境与 mxlexus 客户现场(release 分支)生产性使用,验证目的已达成。 +- 本地开发由 Aspire(`aspire run`,见 mixingx.hub 仓库)完整覆盖,反馈更快,不再需要 K8s dev 环境。 +- dev 使用的伞形 chart `release-charts/mixingx-platform` 是 demo 已淘汰的旧部署模式(参见 `applications/demo/disabled/platform-legacy.yaml`),与当前「每服务独立 release」的目标形态不一致。 + +## 保留了什么 + +- `disabled/` 下三个清单:`platform.yaml`(伞形平台 Application)、`agents.yaml` / `edges.yaml`(ApplicationSet)。根 Application 的目录源不递归子目录,放这里即不会被同步,与 `applications/demo/disabled/` 同一先例。 +- `bootstrap/disabled/mixingx-dev-root.yaml`:dev 的 app-of-apps 根 Application。 +- `environments/dev/` 下全部 values 原样保留(image-version、platform-values、agents、edges、`*-common-values`)。 + +注意:`mixingx-platform` chart 是 dev 唯一的消费者,退役后它在 `release-charts/` 中已无活体使用。重新启用 dev 前先确认该 chart 仍存在且受维护;若已被清理,应按 demo 的「每服务独立 release」模式重建,而不是恢复伞形模式。 + +## 集群侧清理(退役时执行一次) + +根 Application 与子 Application 不会自动消失(root 的 syncPolicy 是 `prune: false`),需要在集群里手动删除: + +```bash +kubectl -n argocd delete application mixingx-dev-root +kubectl -n argocd delete application mixingx-dev-platform mixingx-dev-agents mixingx-dev-edges +kubectl -n argocd delete application mixingx-dev-agent-demo mixingx-dev-edge-demo # ApplicationSet 生成的实例 +kubectl delete namespace mixingx-dev +``` + +- Postgres / edge 数据盘的 PVC 带 `helm.sh/resource-policy: keep`,namespace 删除后 PV 可能残留,按需手动清理。 +- 存储类(`longhorn-platform` / `longhorn-edge-local`)由 demo 的 storageclasses Application 管理,**不要删**。 + +## 如何重新启用 + +1. 前置条件: + - 集群已安装 Argo CD 并注册两个仓库(`mixingx.deploy.git`、`mixingx.hub.chart.git`)。 + - 存储类存在:`kubectl get sc longhorn-platform longhorn-edge-local`(若集群上没有 demo 环境,先 apply `storageclasses/longhorn-demo.yaml`)。 + - 节点标签:agent 默认调度到 `mixingx.io/edge-node=node1`、edge 到 `node2`(见 `environments/dev/agents.yaml`、`edges.yaml` 的 `nodeLabel`);按实际节点重新打标,或删掉 `nodeLabel` 字段。 + - hosts/DNS:`dev.mixingx.local` 指向集群 ingress(traefik)。 + - 镜像 tag:`environments/dev/image-version.yaml` 里只有一个历史分支构建的全局 tag,启用前确认 Harbor 上仍存在;不存在就先跑对应 Drone 流水线产出新 tag 再改该文件(dev 没有 CI 写回,tag 需手动维护)。 +2. 恢复清单并推送: + + ```bash + mv applications/dev/disabled/*.yaml applications/dev/ + mv bootstrap/disabled/mixingx-dev-root.yaml bootstrap/ + git add -A && git commit && git push # 推到 master + ``` + +3. 引导(根 Application 不自动创建,需手动 apply): + + ```bash + kubectl apply -f bootstrap/mixingx-dev-root.yaml + ``` + + root 会建出 `mixingx-dev-platform` / `mixingx-dev-agents` / `mixingx-dev-edges` 三个子应用;子应用默认不自动 sync,需在 Argo CD UI 手动 Sync。 +4. 验证: + + ```bash + kubectl -n mixingx-dev get pods + ``` + + 浏览器访问 `http://dev.mixingx.local`。 diff --git a/applications/dev/agents.yaml b/applications/dev/disabled/agents.yaml similarity index 100% rename from applications/dev/agents.yaml rename to applications/dev/disabled/agents.yaml diff --git a/applications/dev/edges.yaml b/applications/dev/disabled/edges.yaml similarity index 100% rename from applications/dev/edges.yaml rename to applications/dev/disabled/edges.yaml diff --git a/applications/dev/platform.yaml b/applications/dev/disabled/platform.yaml similarity index 100% rename from applications/dev/platform.yaml rename to applications/dev/disabled/platform.yaml diff --git a/bootstrap/mixingx-dev-root.yaml b/bootstrap/disabled/mixingx-dev-root.yaml similarity index 100% rename from bootstrap/mixingx-dev-root.yaml rename to bootstrap/disabled/mixingx-dev-root.yaml diff --git a/environments/dev/README.md b/environments/dev/README.md new file mode 100644 index 0000000..902d7c4 --- /dev/null +++ b/environments/dev/README.md @@ -0,0 +1,3 @@ +# Dev 环境 values(已退役) + +dev 环境已退役,本目录 values 仅作历史保留,Argo CD 不再引用。退役原因与重新启用步骤见 [../../applications/dev/README.md](../../applications/dev/README.md)。