feat(apps): restructure apps deployment, add Penpot HelmRelease, and refactor CDN ingress

这个提交包含在:
rohow
2026-05-22 16:18:32 +08:00
未验证
父节点 c994697d7a
当前提交 15522bbaa8
修改 24 个文件,包含 292 行新增75 行删除
+27 -15
查看文件
@@ -5,16 +5,21 @@
```
flux/
├── clusters/
── dev-cm/ # 集群级别编排
├── kustomization.yaml # 资源列表
├── sources.yaml # HelmRepository 源
├── kube-system.yaml # CoreDNS / NodeLocalDNS
├── infra-devops.yaml # cert-manager / reflector / velero
├── infra-data.yaml # CNPG / Valkey
├── infra-monitor.yaml # Loki / Prometheus (+ post: Promtail)
├── infra-net.yaml # Nginx / CrowdSec / Tailscale
── infra-gitops.yaml # Gitea (+ post: Gitea Actions / Flux Web)
└── apps.yaml # Halo / RustDesk / Fillcode / SinceAI
── base/ # 基础集群编排,仅部署 infrastructure
├── kustomization.yaml # infrastructure 资源列表
├── sources.yaml # infrastructure HelmRepository 源
├── kube-system.yaml # CoreDNS / NodeLocalDNS
├── infra-devops.yaml # cert-manager / reflector / velero
├── infra-data.yaml # CNPG / Valkey
├── infra-monitor.yaml # Loki / Prometheus (+ post: Promtail)
├── infra-net.yaml # Nginx / CrowdSec / Tailscale
── infra-gitops.yaml # Gitea (+ post: Gitea Actions / Flux Web)
└── dev-cm/ # dev-cm 集群 overlay,额外部署 apps
│ ├── kustomization.yaml # 引入 base,并追加 apps / app 依赖层
│ ├── apps-sources.yaml # app HelmRepository 源
│ ├── apps-secrets.yaml # apps namespace 与 app 专属 Secret
│ ├── apps.yaml # Halo / RustDesk / Penpot / Fillcode / SinceAI
│ └── apps-post.yaml # CDN Ingress(依赖 apps
├── infrastructure/
│ ├── sources/ # 所有 HelmRepository 定义
│ ├── kube-system/ # CoreDNS 自定义 + NodeLocalDNS
@@ -24,12 +29,18 @@ flux/
│ │ ├── post-1/ # PG Cluster / ObjectStore / databases / LB
│ │ └── post-2/ # Reflector secret annotations
│ ├── infra-net/ # ingress-nginx, CrowdSec, Tailscale DERP, 证书
│ │ └── post/ # CDN Ingress(依赖 apps,打破循环)
│ ├── infra-monitor/ # Loki, Prometheus+Grafana
│ │ └── post/ # Promtail(依赖 infra-net,打破循环)
│ └── infra-gitops/ # Gitea
│ └── post/ # Gitea Actions + flux-operator WebOIDC/Ingress
└── apps/ # Halo, RustDesk, Whoami, 证书, Ingress
└── apps/
├── sources/ # app HelmRepository 定义
├── secrets/ # apps namespace 与 app 专属 Secret
├── post/ # CDN Ingress(依赖 apps,且引用部分 infra 服务)
├── helmrelease-halo.yaml # Halo
├── helmrelease-rustdesk.yaml # RustDesk
├── helmrelease-penpot.yaml # Penpot
└── ... # app 证书与 Ingress
```
## 前置准备
@@ -62,12 +73,12 @@ sources → secrets → kube-system → infra-devops → infra-data → infra-da
→ infra-monitor → infra-net → infra-devops-post
→ infra-monitor-post (Promtail)
→ infra-gitops
→ apps
infra-net-post (CDN Ingress)
apps-sources → apps-secrets → apps
apps-post (CDN Ingress)
→ infra-gitops-post (suspend=true,需手工凭据)
```
Kustomization 间通过 `dependsOn` + `wait: true` 串行等待,避免顺序错乱。
`clusters/base` 只包含到 `infra-gitops-post` 为止的 infrastructure 部署;`apps-sources``apps-secrets``apps``apps-post` 只在 `clusters/dev-cm` 中声明。Kustomization 间通过 `dependsOn` + `wait: true` 串行等待,避免顺序错乱。
## 部署后手工步骤(infra-gitops-post
@@ -128,4 +139,5 @@ spec:
- **`infra-devops-post`**cert-manager 首次安装时不能依赖 `ServiceMonitor` CRD;post 层只在监控栈就绪后下发 `ClusterIssuer` 与可选 values ConfigMap,避免多个 Kustomization 共同管理同一个 HelmRelease。
- **`infra-monitor-post` (Promtail)**Promtail 依赖至少一个带 `devcm-log-collecting/enabled` 标签的 Podingress-nginx);而 `infra-net` 又依赖 `infra-monitor` 的 CRD。Promtail 放到 post 层并 `dependsOn: infra-net`,打破循环。
- **`apps-post` (CDN Ingress)**CDN Ingress 会引用 `apps`、`infra-gitops`、`infra-monitor` 中的服务,因此不属于 base;只在 `dev-cm` 中声明,并依赖对应服务层。
- **`infra-gitops-post` (Gitea Actions + Flux Web)**:凭据必须在 Gitea 启动后手工创建;放在 post 层并默认 suspend,避免阻塞 bootstrap。