{{/* Agent 点位 — 遍历 .Values.agents 数组,每个元素生成完整的三件套 生成: 后端 Deployment/Service/ConfigMap/Secret + 前端 Deployment/Service + 独立 Postgres StatefulSet/Service/PVC 三者通过 podAffinity 强制同节点 */}} {{- range $site := .Values.agents }} {{- $instName := printf "agent-%s" $site }} {{- $webName := printf "agent-web-%s" $site }} {{- $dbName := printf "agent-db-%s" $site }} {{- $basePath := printf "/agent-%s" $site }} {{- $description := printf "Agent 实例 %s" $site }} # ═══ 实例: {{ $instName }} ({{ $description }}) ═══ {{ include "mixingx.backend" (dict "name" $instName "image" "agent" "role" "agent" "serviceId" $instName "database" $dbName "description" $description "root" $) }} {{ include "mixingx.frontend" (dict "name" $webName "image" "agent-web" "basePath" $basePath "affinity" $instName "root" $) }} {{ include "mixingx.postgres" (dict "name" $instName "database" $dbName "pgStorage" "5Gi" "affinity" true "root" $) }} {{- end }} {{/* Edge 点位 — 遍历 .Values.edges 数组,逻辑同上 */}} {{- range $site := .Values.edges }} {{- $instName := printf "edge-%s" $site }} {{- $webName := printf "edge-web-%s" $site }} {{- $dbName := printf "edge-db-%s" $site }} {{- $basePath := printf "/edge-%s" $site }} {{- $description := printf "Edge 实例 %s" $site }} # ═══ 实例: {{ $instName }} ({{ $description }}) ═══ {{ include "mixingx.backend" (dict "name" $instName "image" "edge" "role" "edge" "serviceId" $instName "database" $dbName "description" $description "root" $) }} {{ include "mixingx.frontend" (dict "name" $webName "image" "edge-web" "basePath" $basePath "affinity" $instName "root" $) }} {{ include "mixingx.postgres" (dict "name" $instName "database" $dbName "pgStorage" "5Gi" "affinity" true "root" $) }} {{- end }}