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,6 +0,0 @@
|
|||||||
apiVersion: v2
|
|
||||||
name: mixingx
|
|
||||||
description: MixingX 全栈部署 Helm Chart(替代 Aspire publish)
|
|
||||||
type: application
|
|
||||||
version: 1.2.0
|
|
||||||
appVersion: "1.0.1"
|
|
||||||
@@ -1,107 +1,42 @@
|
|||||||
# MixingX.Hub.Chart
|
# 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.
|
| Chart | 职责 |
|
||||||
- `release-charts/mixingx-edge-unit` - one edge unit per Helm release.
|
|---|---|
|
||||||
- `release-charts/mixingx-agent-unit` - one agent unit per Helm release.
|
| `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.
|
每个 chart 独立 `helm release`,平台升级不会误删客户自加的 edge/agent 单元。
|
||||||
|
|
||||||
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
|
|
||||||
```
|
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
### 打包发布
|
### CI(Drone)lint + template
|
||||||
|
|
||||||
|
CI 只对 `release-charts/` 做 lint/template(见 hub `.drone.yml`):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
helm package . --version 1.2.0 # 生成 mixingx-1.2.0.tgz
|
helm lint release-charts/mixingx-edge-unit
|
||||||
# 上传到 kube-node 工具的 /charts 页(agents/edges 新格式门禁)
|
helm template ci-edge release-charts/mixingx-edge-unit
|
||||||
```
|
```
|
||||||
|
|
||||||
### 部署(Drone CI 链路)
|
### ArgoCD 部署
|
||||||
|
|
||||||
CI 用相对路径 `./mixingx-chart`(submodule 同名),values 覆盖用 `values-105.yaml`:
|
`mixingx-deploy` 的 ApplicationSet 按 unit chart 逐个发布,每个 edge/agent 一个独立 Helm release。详见 `mixingx-deploy/`。
|
||||||
|
|
||||||
```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
|
|
||||||
```
|
|
||||||
|
|
||||||
## 关联文档
|
## 关联文档
|
||||||
|
|
||||||
部署链路、kube-node 工具、tier 设计详见 hub 仓库:
|
|
||||||
|
|
||||||
- hub [AGENTS.md](https://gitee.com/mixing-tech/mixingx.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-design.md` — 三层调度设计
|
||||||
- `docs/superpowers/specs/2026-07-01-node-tier-affinity-playbook.md` — 操作手册(流程图+场景速查)
|
|
||||||
@@ -1,177 +0,0 @@
|
|||||||
{{/*
|
|
||||||
公共模板:后端 Deployment + Service + ConfigMap + Secret
|
|
||||||
连接串指向独立 postgres({name}-postgres-service)
|
|
||||||
|
|
||||||
参数:
|
|
||||||
name - 服务名
|
|
||||||
image - 镜像名
|
|
||||||
port - 端口(默认 8080)
|
|
||||||
role - mixingx.io/role
|
|
||||||
replicas - 副本数(默认 1)
|
|
||||||
serviceId - 业务身份(可选)
|
|
||||||
database - 数据库名(有则生成 PG 连接串,指向 {name}-postgres-service)
|
|
||||||
rbac - 是否需要 serviceAccount(只有 gateway)
|
|
||||||
description - 中文展示名(可选,写为 mixingx.io/description annotation)
|
|
||||||
root - $ (root context)
|
|
||||||
*/}}
|
|
||||||
{{- define "mixingx.backend" -}}
|
|
||||||
{{- $root := .root -}}
|
|
||||||
{{- $port := .port | default 8080 -}}
|
|
||||||
{{- $pgHost := printf "%s-postgres-service" .name -}}
|
|
||||||
---
|
|
||||||
# Deployment: {{ .name }}
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-deployment
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/instance: {{ $root.Release.Name }}
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
spec:
|
|
||||||
replicas: {{ .replicas | default 1 }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
spec:
|
|
||||||
{{- if .rbac }}
|
|
||||||
serviceAccountName: gateway-sa
|
|
||||||
{{- end }}
|
|
||||||
{{- if .nodeName }}
|
|
||||||
nodeName: {{ .nodeName }}
|
|
||||||
{{- else if .pointAffinity }}
|
|
||||||
{{ include "mixingx.pointAffinity" (dict "affinity" .pointAffinity "root" .root) }}
|
|
||||||
{{- else }}
|
|
||||||
{{ include "mixingx.tierAffinity" (dict "role" .role "root" .root) }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
|
||||||
- name: {{ .name }}
|
|
||||||
image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: {{ $port }}
|
|
||||||
protocol: TCP
|
|
||||||
envFrom:
|
|
||||||
- configMapRef:
|
|
||||||
name: {{ .name }}-config
|
|
||||||
- secretRef:
|
|
||||||
name: {{ .name }}-secrets
|
|
||||||
env:
|
|
||||||
# 时区(部署地域覆盖,优先级 > 镜像内 /etc/localtime)
|
|
||||||
- name: TZ
|
|
||||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
|
||||||
{{- if .rbac }}
|
|
||||||
- name: POD_NAMESPACE
|
|
||||||
valueFrom:
|
|
||||||
fieldRef:
|
|
||||||
fieldPath: metadata.namespace
|
|
||||||
{{- end }}
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /health
|
|
||||||
port: http
|
|
||||||
scheme: HTTP
|
|
||||||
initialDelaySeconds: 120
|
|
||||||
periodSeconds: 30
|
|
||||||
timeoutSeconds: 15
|
|
||||||
failureThreshold: 12 # 120 + 30×12 = 480s 才杀,容忍 .NET 冷启动连库
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /alive
|
|
||||||
port: http
|
|
||||||
scheme: HTTP
|
|
||||||
initialDelaySeconds: 60
|
|
||||||
periodSeconds: 30
|
|
||||||
timeoutSeconds: 10
|
|
||||||
failureThreshold: 8 # 60 + 30×8 = 300s 才标 NotReady
|
|
||||||
|
|
||||||
---
|
|
||||||
# Service: {{ .name }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-service
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
{{- if and .role (ne .role "gateway") }}
|
|
||||||
mixingx.io/role: {{ .role }}
|
|
||||||
mixingx.io/node-id: {{ .name }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if and .role (ne .role "gateway") .description }}
|
|
||||||
annotations:
|
|
||||||
mixingx.io/description: {{ .description | quote }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
port: {{ $port }}
|
|
||||||
targetPort: http
|
|
||||||
protocol: TCP
|
|
||||||
|
|
||||||
---
|
|
||||||
# ConfigMap: {{ .name }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-config
|
|
||||||
data:
|
|
||||||
HTTP_PORTS: "{{ $port }}"
|
|
||||||
REDIS_HOST: "{{ $root.Values.sharedInfra.redis.host }}"
|
|
||||||
REDIS_PORT: "{{ $root.Values.sharedInfra.redis.port }}"
|
|
||||||
POSTGRESQL_HOST: "{{ $pgHost }}"
|
|
||||||
POSTGRESQL_PORT: "{{ $root.Values.sharedInfra.postgres.port }}"
|
|
||||||
POSTGRESQL_USERNAME: "{{ $root.Values.sharedInfra.postgres.username }}"
|
|
||||||
MESSAGING_HOST: "{{ $root.Values.sharedInfra.rabbitmq.host }}"
|
|
||||||
MESSAGING_PORT: "{{ $root.Values.sharedInfra.rabbitmq.port }}"
|
|
||||||
MESSAGING_USERNAME: "{{ $root.Values.sharedInfra.rabbitmq.username }}"
|
|
||||||
{{- if not .rbac }}
|
|
||||||
services__gateway__http__0: "http://gateway-service:8080"
|
|
||||||
{{- end }}
|
|
||||||
{{- if .serviceId }}
|
|
||||||
{{- if hasPrefix "agent" .name }}
|
|
||||||
AGENT_SERVICE_ID: "{{ .serviceId }}"
|
|
||||||
{{- if .phaseType }}
|
|
||||||
AGENT_PHASE_TYPE: "{{ .phaseType }}"
|
|
||||||
{{- end }}
|
|
||||||
{{- else if hasPrefix "edge" .name }}
|
|
||||||
EDGE_SERVICE_ID: "{{ .serviceId }}"
|
|
||||||
{{- else if hasPrefix "sso" .name }}
|
|
||||||
SSO_SERVICE_ID: "{{ .serviceId }}"
|
|
||||||
{{- else if hasPrefix "ultra" .name }}
|
|
||||||
ULTRA_SERVICE_ID: "{{ .serviceId }}"
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
OTEL_EXPORTER_OTLP_ENDPOINT: "{{ $root.Values.sharedInfra.otlp.endpoint }}"
|
|
||||||
OTEL_EXPORTER_OTLP_PROTOCOL: "{{ $root.Values.sharedInfra.otlp.protocol }}"
|
|
||||||
OTEL_SERVICE_NAME: "{{ .name }}"
|
|
||||||
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
|
|
||||||
|
|
||||||
---
|
|
||||||
# Secret: {{ .name }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-secrets
|
|
||||||
type: Opaque
|
|
||||||
stringData:
|
|
||||||
ConnectionStrings__redis: "{{ $root.Values.sharedInfra.redis.host }}:{{ $root.Values.sharedInfra.redis.port }},password={{ $root.Values.sharedInfra.redis.password }}"
|
|
||||||
REDIS_PASSWORD: "{{ $root.Values.sharedInfra.redis.password }}"
|
|
||||||
REDIS_URI: "redis://:{{ $root.Values.sharedInfra.redis.password }}@{{ $root.Values.sharedInfra.redis.host }}:{{ $root.Values.sharedInfra.redis.port }}"
|
|
||||||
{{- if .database }}
|
|
||||||
ConnectionStrings__PostgreSQL: "Host={{ $pgHost }};Port={{ $root.Values.sharedInfra.postgres.port }};Username={{ $root.Values.sharedInfra.postgres.username }};Password={{ $root.Values.sharedInfra.postgres.password }};Database={{ .database }}"
|
|
||||||
POSTGRESQL_PASSWORD: "{{ $root.Values.sharedInfra.postgres.password }}"
|
|
||||||
POSTGRESQL_URI: "postgresql://{{ $root.Values.sharedInfra.postgres.username }}:{{ $root.Values.sharedInfra.postgres.password }}@{{ $pgHost }}:{{ $root.Values.sharedInfra.postgres.port }}/{{ .database }}"
|
|
||||||
POSTGRESQL_DATABASENAME: "{{ .database }}"
|
|
||||||
{{- end }}
|
|
||||||
ConnectionStrings__messaging: "amqp://{{ $root.Values.sharedInfra.rabbitmq.username }}:{{ $root.Values.sharedInfra.rabbitmq.password }}@{{ $root.Values.sharedInfra.rabbitmq.host }}:{{ $root.Values.sharedInfra.rabbitmq.port }}"
|
|
||||||
MESSAGING_PASSWORD: "{{ $root.Values.sharedInfra.rabbitmq.password }}"
|
|
||||||
MESSAGING_URI: "amqp://{{ $root.Values.sharedInfra.rabbitmq.username }}:{{ $root.Values.sharedInfra.rabbitmq.password }}@{{ $root.Values.sharedInfra.rabbitmq.host }}:{{ $root.Values.sharedInfra.rabbitmq.port }}"
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
{{/*
|
|
||||||
公共模板:前端 Deployment + Service
|
|
||||||
可选 podAffinity(四胞胎用:前端和后端同节点)
|
|
||||||
|
|
||||||
参数:
|
|
||||||
name - 服务名(agent-web-0 / sso-web ...)
|
|
||||||
image - 镜像名
|
|
||||||
port - 端口(默认 80)
|
|
||||||
basePath - vite base path
|
|
||||||
affinity - 要亲和的目标服务名(如 "agent-0"),空则不配亲和
|
|
||||||
root - $ (root context)
|
|
||||||
*/}}
|
|
||||||
{{- define "mixingx.frontend" -}}
|
|
||||||
{{- $root := .root -}}
|
|
||||||
{{- $port := .port | default 80 -}}
|
|
||||||
---
|
|
||||||
# Deployment: {{ .name }}
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-deployment
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/instance: {{ $root.Release.Name }}
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
spec:
|
|
||||||
{{- if .nodeName }}
|
|
||||||
nodeName: {{ .nodeName }}
|
|
||||||
{{- else if .affinity }}
|
|
||||||
# 四胞胎:前端必须和后端同节点(podAffinity + 点位/tier nodeAffinity 合并到同一 affinity 块)
|
|
||||||
affinity:
|
|
||||||
podAffinity:
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
- labelSelector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: {{ .affinity }}
|
|
||||||
topologyKey: kubernetes.io/hostname
|
|
||||||
{{- if .pointAffinity }}
|
|
||||||
{{ include "mixingx.pointNodeAffinity" (dict "affinity" .pointAffinity "root" $root) }}
|
|
||||||
{{- else if and $root.Values.tier $root.Values.tier.enabled }}
|
|
||||||
{{ include "mixingx.tierNodeAffinity" (dict "role" .tierRole "root" $root) }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else if .pointAffinity }}
|
|
||||||
{{ include "mixingx.pointAffinity" (dict "affinity" .pointAffinity "root" $root) }}
|
|
||||||
{{- else if and $root.Values.tier $root.Values.tier.enabled }}
|
|
||||||
{{ include "mixingx.tierAffinity" (dict "role" .tierRole "root" $root) }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
|
||||||
- name: {{ .name }}
|
|
||||||
image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: {{ $port }}
|
|
||||||
protocol: TCP
|
|
||||||
env:
|
|
||||||
# 时区(部署地域覆盖,优先级 > 镜像内 /etc/localtime)
|
|
||||||
- name: TZ
|
|
||||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
|
||||||
- name: VITE_BASE_PATH
|
|
||||||
value: "{{ .basePath }}"
|
|
||||||
- name: PORT
|
|
||||||
value: "{{ $port }}"
|
|
||||||
|
|
||||||
---
|
|
||||||
# Service: {{ .name }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-service
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
mixingx.io/role: web
|
|
||||||
mixingx.io/node-id: {{ .name }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
port: {{ $port }}
|
|
||||||
targetPort: http
|
|
||||||
protocol: TCP
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{{/*
|
|
||||||
完整镜像名: registry/image:tag
|
|
||||||
用法: {{ include "mixingx.image" (dict "image" .image "Values" $.Values) }}
|
|
||||||
或: {{ include "mixingx.image" . }}(range 内,. 有 image 字段,但需传 Values)
|
|
||||||
*/}}
|
|
||||||
{{- define "mixingx.image" -}}
|
|
||||||
{{ required "registry is required" .Values.registry }}/{{ required "image is required" .image }}:{{ .Values.tag | default "latest" }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
标准标签(所有资源共用)
|
|
||||||
用法: {{ include "mixingx.labels" (dict "name" "sso" "Release" $.Release) }}
|
|
||||||
*/}}
|
|
||||||
{{- define "mixingx.labels" -}}
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Service 的 mixingx.io 标签(gateway 服务发现用)
|
|
||||||
只在 role 不为空且不为 "gateway" 时打
|
|
||||||
*/}}
|
|
||||||
{{- define "mixingx.discoveryLabels" -}}
|
|
||||||
{{- if and .role (ne .role "gateway") }}
|
|
||||||
mixingx.io/role: {{ .role }}
|
|
||||||
mixingx.io/node-id: {{ .name }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
{{/*
|
|
||||||
渲染点位级原生 nodeAffinity — 完整 affinity 块。
|
|
||||||
三层优先级的中层:点位配了 nodeAffinity 时覆盖全局 tier(被 nodeName 覆盖)。
|
|
||||||
|
|
||||||
参数:
|
|
||||||
affinity - Point 对象的 nodeAffinity 字段 {required?: [...], preferred?: [...]}
|
|
||||||
root - $ (root context)
|
|
||||||
*/}}
|
|
||||||
{{- define "mixingx.pointAffinity" -}}
|
|
||||||
{{- $aff := .affinity -}}
|
|
||||||
affinity:
|
|
||||||
nodeAffinity:
|
|
||||||
{{- with $aff.required }}
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
nodeSelectorTerms:
|
|
||||||
{{- range . }}
|
|
||||||
- matchExpressions:
|
|
||||||
- key: {{ .key }}
|
|
||||||
operator: {{ .operator }}
|
|
||||||
{{- if .values }}
|
|
||||||
values:
|
|
||||||
{{- range .values }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with $aff.preferred }}
|
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
{{- range . }}
|
|
||||||
- weight: {{ .weight }}
|
|
||||||
preference:
|
|
||||||
matchExpressions:
|
|
||||||
- key: {{ .key }}
|
|
||||||
operator: {{ .operator }}
|
|
||||||
{{- if .values }}
|
|
||||||
values:
|
|
||||||
{{- range .values }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/* 只渲染 nodeAffinity 子块(供 frontend/postgres 合并 podAffinity 用)*/}}
|
|
||||||
{{- define "mixingx.pointNodeAffinity" -}}
|
|
||||||
{{- $aff := .affinity -}}
|
|
||||||
nodeAffinity:
|
|
||||||
{{- with $aff.required }}
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
nodeSelectorTerms:
|
|
||||||
{{- range . }}
|
|
||||||
- matchExpressions:
|
|
||||||
- key: {{ .key }}
|
|
||||||
operator: {{ .operator }}
|
|
||||||
{{- if .values }}
|
|
||||||
values:
|
|
||||||
{{- range .values }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with $aff.preferred }}
|
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
{{- range . }}
|
|
||||||
- weight: {{ .weight }}
|
|
||||||
preference:
|
|
||||||
matchExpressions:
|
|
||||||
- key: {{ .key }}
|
|
||||||
operator: {{ .operator }}
|
|
||||||
{{- if .values }}
|
|
||||||
values:
|
|
||||||
{{- range .values }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
{{/*
|
|
||||||
公共模板:生成独立 postgres StatefulSet + Service + PVC
|
|
||||||
每个有 DB 的服务(agent/edge/sso/ultra)各自一个
|
|
||||||
|
|
||||||
参数:
|
|
||||||
name - 服务名(agent-0 / sso ...)
|
|
||||||
database - 数据库名(agent-db-0 / sso-db)
|
|
||||||
pgStorage - PVC 容量(默认 5Gi)
|
|
||||||
affinity - 是否需要和后端同节点(四胞胎用 true)
|
|
||||||
root - $ (root context)
|
|
||||||
*/}}
|
|
||||||
{{- define "mixingx.postgres" -}}
|
|
||||||
{{- $root := .root -}}
|
|
||||||
---
|
|
||||||
# StatefulSet: {{ .name }}-postgres
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-postgres
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: {{ .name }}-postgres
|
|
||||||
spec:
|
|
||||||
serviceName: {{ .name }}-postgres-service
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}-postgres
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: data
|
|
||||||
spec:
|
|
||||||
accessModes: ["ReadWriteOnce"]
|
|
||||||
storageClassName: local-path
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .pgStorage | default "5Gi" }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}-postgres
|
|
||||||
spec:
|
|
||||||
{{- if .nodeName }}
|
|
||||||
nodeName: {{ .nodeName }}
|
|
||||||
{{- else if .affinity }}
|
|
||||||
# 四胞胎:postgres 必须和后端 Pod 同节点(podAffinity + 点位/tier nodeAffinity 合并到同一 affinity 块)
|
|
||||||
affinity:
|
|
||||||
podAffinity:
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
- labelSelector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
topologyKey: kubernetes.io/hostname
|
|
||||||
{{- if .pointAffinity }}
|
|
||||||
{{ include "mixingx.pointNodeAffinity" (dict "affinity" .pointAffinity "root" $root) }}
|
|
||||||
{{- else if and $root.Values.tier $root.Values.tier.enabled }}
|
|
||||||
{{ include "mixingx.tierNodeAffinity" (dict "role" .tierRole "root" $root) }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else if .pointAffinity }}
|
|
||||||
{{ include "mixingx.pointAffinity" (dict "affinity" .pointAffinity "root" $root) }}
|
|
||||||
{{- else if and $root.Values.tier $root.Values.tier.enabled }}
|
|
||||||
{{ include "mixingx.tierAffinity" (dict "role" .tierRole "root" $root) }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
|
||||||
- name: postgres
|
|
||||||
image: docker.io/library/postgres:17
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
env:
|
|
||||||
- name: POSTGRES_PASSWORD
|
|
||||||
value: "{{ $root.Values.sharedInfra.postgres.password }}"
|
|
||||||
- name: POSTGRES_DB
|
|
||||||
value: "{{ .database }}"
|
|
||||||
- name: POSTGRES_USER
|
|
||||||
value: "{{ $root.Values.sharedInfra.postgres.username }}"
|
|
||||||
- name: PGDATA
|
|
||||||
value: /var/lib/postgresql/data/pgdata
|
|
||||||
ports:
|
|
||||||
- name: tcp
|
|
||||||
containerPort: {{ $root.Values.sharedInfra.postgres.port }}
|
|
||||||
protocol: TCP
|
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: /var/lib/postgresql/data
|
|
||||||
|
|
||||||
---
|
|
||||||
# Service: {{ .name }}-postgres-service
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-postgres-service
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: {{ .name }}-postgres
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: {{ .name }}-postgres
|
|
||||||
ports:
|
|
||||||
- name: tcp
|
|
||||||
port: {{ $root.Values.sharedInfra.postgres.port }}
|
|
||||||
targetPort: tcp
|
|
||||||
protocol: TCP
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
{{/*
|
|
||||||
渲染全局 tier 档位调度 nodeAffinity — 完整 affinity 块(无现成 affinity 的模板用)。
|
|
||||||
三层优先级的最底层(点位 nodeName > 点位 nodeAffinity > 全局 tier)。
|
|
||||||
|
|
||||||
参数:
|
|
||||||
role - 服务角色(gateway/sso/ultra/agent/edge/audit/sharedDatastores)
|
|
||||||
root - $ (root context)
|
|
||||||
*/}}
|
|
||||||
{{- define "mixingx.tierAffinity" -}}
|
|
||||||
{{- $root := .root -}}
|
|
||||||
{{- $cfg := $root.Values.tier -}}
|
|
||||||
{{- if and $cfg $cfg.enabled -}}
|
|
||||||
{{- $svc := index $cfg.services .role -}}
|
|
||||||
{{- if $svc -}}
|
|
||||||
{{- $label := $cfg.nodeLabel | default "mixingx.io/tier" -}}
|
|
||||||
{{- if eq $svc.mode "required" }}
|
|
||||||
affinity:
|
|
||||||
nodeAffinity:
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
nodeSelectorTerms:
|
|
||||||
- matchExpressions:
|
|
||||||
- key: {{ $label }}
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
{{- range $svc.tiers }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else if eq $svc.mode "preferred" }}
|
|
||||||
affinity:
|
|
||||||
nodeAffinity:
|
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
{{- range $svc.tiers }}
|
|
||||||
- weight: 100
|
|
||||||
preference:
|
|
||||||
matchExpressions:
|
|
||||||
- key: {{ $label }}
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/* 只渲染 nodeAffinity 子块(供 frontend/postgres 合并 podAffinity 用)*/}}
|
|
||||||
{{- define "mixingx.tierNodeAffinity" -}}
|
|
||||||
{{- $root := .root -}}
|
|
||||||
{{- $cfg := $root.Values.tier -}}
|
|
||||||
{{- if and $cfg $cfg.enabled -}}
|
|
||||||
{{- $svc := index $cfg.services .role -}}
|
|
||||||
{{- if $svc -}}
|
|
||||||
{{- $label := $cfg.nodeLabel | default "mixingx.io/tier" -}}
|
|
||||||
{{- if eq $svc.mode "required" }}
|
|
||||||
nodeAffinity:
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
nodeSelectorTerms:
|
|
||||||
- matchExpressions:
|
|
||||||
- key: {{ $label }}
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
{{- range $svc.tiers }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else if eq $svc.mode "preferred" }}
|
|
||||||
nodeAffinity:
|
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
{{- range $svc.tiers }}
|
|
||||||
- weight: 100
|
|
||||||
preference:
|
|
||||||
matchExpressions:
|
|
||||||
- key: {{ $label }}
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{{/*
|
|
||||||
业务 Ingress — 所有流量 → gateway-service
|
|
||||||
浏览器访问 app.mixingx.local → Traefik → gateway → 各后端/前端
|
|
||||||
*/}}
|
|
||||||
{{- if .Values.ingress.enabled }}
|
|
||||||
---
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: Ingress
|
|
||||||
metadata:
|
|
||||||
name: app-ingress
|
|
||||||
annotations:
|
|
||||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
|
||||||
spec:
|
|
||||||
ingressClassName: traefik
|
|
||||||
rules:
|
|
||||||
- host: {{ .Values.ingress.domain }}
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
pathType: Prefix
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: {{ .Values.ingress.gatewayService }}
|
|
||||||
port:
|
|
||||||
number: {{ .Values.ingress.gatewayPort }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
{{- if .Values.audit.enabled }}
|
|
||||||
{{- $root := $ }}
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: audit-deployment
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: audit
|
|
||||||
spec:
|
|
||||||
replicas: {{ .Values.audit.replicas | default 1 }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: audit
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: audit
|
|
||||||
spec:
|
|
||||||
{{ include "mixingx.tierAffinity" (dict "role" "audit" "root" $) }}
|
|
||||||
containers:
|
|
||||||
- name: audit
|
|
||||||
image: "{{ .Values.registry }}/{{ .Values.audit.image }}:{{ .Values.tag | default "latest" }}"
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: {{ .Values.audit.port }}
|
|
||||||
protocol: TCP
|
|
||||||
env:
|
|
||||||
# 时区(部署地域覆盖)
|
|
||||||
- name: TZ
|
|
||||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
|
||||||
- name: MONGODB_URI
|
|
||||||
value: "mongodb://{{ .Values.sharedInfra.mongo.username }}:{{ .Values.sharedInfra.mongo.password }}@{{ .Values.sharedInfra.mongo.host }}:{{ .Values.sharedInfra.mongo.port }}"
|
|
||||||
- name: MONGODB_DATABASE
|
|
||||||
value: "{{ .Values.sharedInfra.mongo.database }}"
|
|
||||||
- name: RABBITMQ_URI
|
|
||||||
value: "amqp://{{ .Values.sharedInfra.rabbitmq.username }}:{{ .Values.sharedInfra.rabbitmq.password }}@{{ .Values.sharedInfra.rabbitmq.host }}:{{ .Values.sharedInfra.rabbitmq.port }}"
|
|
||||||
- name: PORT
|
|
||||||
value: "{{ .Values.audit.port }}"
|
|
||||||
- name: HOST
|
|
||||||
value: "0.0.0.0"
|
|
||||||
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
|
||||||
value: "{{ .Values.sharedInfra.otlp.endpoint }}"
|
|
||||||
- name: OTEL_SERVICE_NAME
|
|
||||||
value: "audit"
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: audit-service
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: audit
|
|
||||||
mixingx.io/role: audit
|
|
||||||
mixingx.io/node-id: audit
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: audit
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
port: {{ .Values.audit.port }}
|
|
||||||
targetPort: http
|
|
||||||
protocol: TCP
|
|
||||||
{{- end }}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{{ include "mixingx.backend" (dict "name" "gateway" "image" "gateway" "role" "gateway" "replicas" 2 "rbac" true "root" $) }}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
{{/*
|
|
||||||
Aspire Dashboard — OTLP 遥测数据接收端
|
|
||||||
所有后端的 OTEL_EXPORTER_OTLP_ENDPOINT 指向这里的 :18889
|
|
||||||
也是可视化日志/追踪/指标的 Web 界面(:18888)
|
|
||||||
*/}}
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: k8s-dashboard-deployment
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: k8s-dashboard
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: k8s-dashboard
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: k8s-dashboard
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: k8s-dashboard
|
|
||||||
image: mcr.microsoft.com/dotnet/nightly/aspire-dashboard:latest
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 18888
|
|
||||||
protocol: TCP
|
|
||||||
- name: otlp-grpc
|
|
||||||
containerPort: 18889
|
|
||||||
protocol: TCP
|
|
||||||
- name: otlp-http
|
|
||||||
containerPort: 18890
|
|
||||||
protocol: TCP
|
|
||||||
# Dashboard 无状态,数据在内存(重启清空,不影响业务)
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: 256Mi
|
|
||||||
limits:
|
|
||||||
memory: 512Mi
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: k8s-dashboard-service
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: k8s-dashboard
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: k8s-dashboard
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
port: 18888
|
|
||||||
targetPort: http
|
|
||||||
protocol: TCP
|
|
||||||
- name: otlp-grpc
|
|
||||||
port: 18889
|
|
||||||
targetPort: otlp-grpc
|
|
||||||
protocol: TCP
|
|
||||||
- name: otlp-http
|
|
||||||
port: 18890
|
|
||||||
targetPort: otlp-http
|
|
||||||
protocol: TCP
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
{{/*
|
|
||||||
Gateway K8s 服务发现 RBAC
|
|
||||||
gateway 需要读 Service 列表(查 mixingx.io/role 标签)来发现 agent/edge 等
|
|
||||||
包括 mqtt-broker Service(查 mixingx.io/role=mqtt-broker,Task 07)
|
|
||||||
权限只有 Service get/list/watch,不包含 Pod/Secret/ConfigMap
|
|
||||||
*/}}
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: gateway-sa
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: gateway
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: Role
|
|
||||||
metadata:
|
|
||||||
name: gateway-service-reader
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: gateway
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["services"]
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name: gateway-service-reader-binding
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: gateway
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: Role
|
|
||||||
name: gateway-service-reader
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: gateway-sa
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
{{/*
|
|
||||||
Agent 点位 — 遍历 .Values.agents 数组,每个元素生成完整的三件套
|
|
||||||
生成: 后端 Deployment/Service/ConfigMap/Secret + 前端 Deployment/Service + 独立 Postgres StatefulSet/Service/PVC
|
|
||||||
三者通过 podAffinity 强制同节点
|
|
||||||
点位元素可为字符串(老 "0")或对象(新 {site, nodeName?, nodeAffinity?})
|
|
||||||
*/}}
|
|
||||||
{{- range $raw := .Values.agents }}
|
|
||||||
{{- $site := "" -}}
|
|
||||||
{{- $nodeName := "" -}}
|
|
||||||
{{- $pointAffinity := "" -}}
|
|
||||||
{{- $phaseType := "" -}}
|
|
||||||
{{- if kindIs "map" $raw -}}
|
|
||||||
{{- $site = $raw.site | default "" -}}
|
|
||||||
{{- $nodeName = $raw.nodeName | default "" -}}
|
|
||||||
{{- $pointAffinity = $raw.nodeAffinity | default "" -}}
|
|
||||||
{{- $phaseType = $raw.phaseType | default "" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $site = $raw | toString -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $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 "phaseType" $phaseType "database" $dbName "description" $description "nodeName" $nodeName "pointAffinity" $pointAffinity "root" $) }}
|
|
||||||
{{ include "mixingx.frontend" (dict "name" $webName "image" "agent-web" "basePath" $basePath "affinity" $instName "nodeName" $nodeName "pointAffinity" $pointAffinity "tierRole" "agent" "root" $) }}
|
|
||||||
{{ include "mixingx.postgres" (dict "name" $instName "database" $dbName "pgStorage" "5Gi" "affinity" true "nodeName" $nodeName "pointAffinity" $pointAffinity "tierRole" "agent" "root" $) }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
Edge 点位 — 遍历 .Values.edges 数组,逻辑同上
|
|
||||||
*/}}
|
|
||||||
{{- range $raw := .Values.edges }}
|
|
||||||
{{- $site := "" -}}
|
|
||||||
{{- $nodeName := "" -}}
|
|
||||||
{{- $pointAffinity := "" -}}
|
|
||||||
{{- if kindIs "map" $raw -}}
|
|
||||||
{{- $site = $raw.site | default "" -}}
|
|
||||||
{{- $nodeName = $raw.nodeName | default "" -}}
|
|
||||||
{{- $pointAffinity = $raw.nodeAffinity | default "" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- $site = $raw | toString -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- $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 "nodeName" $nodeName "pointAffinity" $pointAffinity "root" $) }}
|
|
||||||
{{ include "mixingx.frontend" (dict "name" $webName "image" "edge-web" "basePath" $basePath "affinity" $instName "nodeName" $nodeName "pointAffinity" $pointAffinity "tierRole" "edge" "root" $) }}
|
|
||||||
{{ include "mixingx.postgres" (dict "name" $instName "database" $dbName "pgStorage" "5Gi" "affinity" true "nodeName" $nodeName "pointAffinity" $pointAffinity "tierRole" "edge" "root" $) }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
{{/*
|
|
||||||
协议模拟器模板 — 遍历 mocks 列表
|
|
||||||
每个生成: Deployment + Service
|
|
||||||
*/}}
|
|
||||||
{{- range .Values.mocks }}
|
|
||||||
{{- $root := $ }}
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-deployment
|
|
||||||
labels:
|
|
||||||
{{- include "mixingx.labels" (dict "name" .name "Release" $root.Release) | nindent 4 }}
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: {{ .name }}
|
|
||||||
image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
{{- if .scene }}
|
|
||||||
args:
|
|
||||||
- "--port"
|
|
||||||
- "{{ .port }}"
|
|
||||||
- "--scene"
|
|
||||||
- "{{ .scene }}"
|
|
||||||
{{- end }}
|
|
||||||
ports:
|
|
||||||
- name: tcp
|
|
||||||
containerPort: {{ .port }}
|
|
||||||
protocol: TCP
|
|
||||||
env:
|
|
||||||
# 时区(部署地域覆盖)
|
|
||||||
- name: TZ
|
|
||||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-service
|
|
||||||
labels:
|
|
||||||
{{- include "mixingx.labels" (dict "name" .name "Release" $root.Release) | nindent 4 }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
ports:
|
|
||||||
- name: tcp
|
|
||||||
port: {{ .port }}
|
|
||||||
targetPort: tcp
|
|
||||||
protocol: TCP
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
{{/*
|
|
||||||
pgAdmin — 在 K3s 内,用 ClusterIP 直连所有 postgres Pod
|
|
||||||
宿主的 pgAdmin(5050)是开发用的,这个是测试环境用的
|
|
||||||
*/}}
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-deployment
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: pgadmin
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: pgadmin
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: pgadmin
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: pgadmin
|
|
||||||
image: dpage/pgadmin4:latest
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
env:
|
|
||||||
- name: PGADMIN_DEFAULT_EMAIL
|
|
||||||
value: "admin@example.com" # 用 example.com(.local 是 mDNS 保留 TLD,新版 pgadmin email-validator 拒绝)
|
|
||||||
- name: PGADMIN_DEFAULT_PASSWORD
|
|
||||||
value: "Admin12345"
|
|
||||||
- name: PGADMIN_CONFIG_SERVER_MODE
|
|
||||||
value: "False"
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 80
|
|
||||||
protocol: TCP
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: 128Mi
|
|
||||||
limits:
|
|
||||||
memory: 256Mi
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-service
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: pgadmin
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: pgadmin
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
port: 80
|
|
||||||
targetPort: http
|
|
||||||
protocol: TCP
|
|
||||||
---
|
|
||||||
# Ingress:走 pgadmin.mixingx.local 域名(和宿主的 pgAdmin 分开)
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: Ingress
|
|
||||||
metadata:
|
|
||||||
name: pgadmin-k8s-ingress
|
|
||||||
annotations:
|
|
||||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
|
||||||
spec:
|
|
||||||
ingressClassName: traefik
|
|
||||||
rules:
|
|
||||||
- host: pgadmin-k8s.mixingx.local
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
pathType: Prefix
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: pgadmin-service
|
|
||||||
port:
|
|
||||||
number: 80
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
{{/*
|
|
||||||
共享数据层:redis + mongo + rabbitmq
|
|
||||||
所有服务连同一个(StatefulSet + PVC 持久化)
|
|
||||||
postgres 不在这里 — 每个服务有独立的 postgres(见 _postgres.tpl)
|
|
||||||
*/}}
|
|
||||||
{{- range .Values.sharedDatastores }}
|
|
||||||
{{- $root := $ }}
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-statefulset
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
spec:
|
|
||||||
serviceName: {{ .name }}-service
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: data
|
|
||||||
spec:
|
|
||||||
accessModes: ["ReadWriteOnce"]
|
|
||||||
storageClassName: local-path
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .storage }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
spec:
|
|
||||||
{{ include "mixingx.tierAffinity" (dict "role" "sharedDatastores" "root" $root) }}
|
|
||||||
containers:
|
|
||||||
- name: {{ .name }}
|
|
||||||
image: {{ .image }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- name: tcp
|
|
||||||
containerPort: {{ .port }}
|
|
||||||
protocol: TCP
|
|
||||||
{{- if eq .name "redis" }}
|
|
||||||
command: ["/bin/sh"]
|
|
||||||
args:
|
|
||||||
- "-c"
|
|
||||||
- "redis-server --requirepass {{ $root.Values.sharedInfra.redis.password }} --save 60 1"
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq .name "mongo" }}
|
|
||||||
env:
|
|
||||||
- name: MONGO_INITDB_ROOT_USERNAME
|
|
||||||
value: "{{ $root.Values.sharedInfra.mongo.username }}"
|
|
||||||
- name: MONGO_INITDB_ROOT_PASSWORD
|
|
||||||
value: "{{ $root.Values.sharedInfra.mongo.password }}"
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq .name "messaging" }}
|
|
||||||
env:
|
|
||||||
- name: RABBITMQ_DEFAULT_USER
|
|
||||||
value: "{{ $root.Values.sharedInfra.rabbitmq.username }}"
|
|
||||||
- name: RABBITMQ_DEFAULT_PASS
|
|
||||||
value: "{{ $root.Values.sharedInfra.rabbitmq.password }}"
|
|
||||||
{{- end }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: {{ .mountPath }}
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: {{ .name }}-service
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: {{ .name }}
|
|
||||||
ports:
|
|
||||||
- name: tcp
|
|
||||||
port: {{ .port }}
|
|
||||||
targetPort: tcp
|
|
||||||
protocol: TCP
|
|
||||||
{{- if eq .name "messaging" }}
|
|
||||||
- name: management
|
|
||||||
port: 15672
|
|
||||||
targetPort: 15672
|
|
||||||
protocol: TCP
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{{/*
|
|
||||||
独立实例(sso/ultra)— 遍历 values.standalones 数组
|
|
||||||
每个实例生成:后端 Deployment + 前端 Deployment + 独立 postgres StatefulSet(无亲和,多副本)
|
|
||||||
|
|
||||||
与 instances 的差异:无 podAffinity、replicas 可 >1、pgStorage 量级更大。
|
|
||||||
*/}}
|
|
||||||
{{- range $inst := .Values.standalones }}
|
|
||||||
{{- $root := $ }}
|
|
||||||
# ═══ 实例: {{ $inst.name }} ({{ $inst.description }}) ═══
|
|
||||||
# 1. 后端(多副本)
|
|
||||||
{{ include "mixingx.backend" (dict "name" $inst.name "image" $inst.image "role" $inst.role "replicas" $inst.replicas "serviceId" $inst.serviceId "database" $inst.database "description" $inst.description "root" $root) }}
|
|
||||||
|
|
||||||
# 2. 前端(无 podAffinity,走 tier nodeAffinity)
|
|
||||||
{{ include "mixingx.frontend" (dict "name" $inst.webName "image" $inst.webImage "basePath" $inst.webBasePath "tierRole" $inst.role "root" $root) }}
|
|
||||||
|
|
||||||
# 3. 独立 postgres(无 podAffinity,走 tier nodeAffinity)
|
|
||||||
{{ include "mixingx.postgres" (dict "name" $inst.name "database" $inst.database "pgStorage" $inst.pgStorage "affinity" false "tierRole" $inst.role "root" $root) }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# 105 生产环境 values(覆盖 values.yaml 的默认值)
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
|
|
||||||
registry: 192.168.1.105:8888/mixingx
|
|
||||||
|
|
||||||
infra:
|
|
||||||
postgres:
|
|
||||||
password: "Admin12345" # 105 实际密码
|
|
||||||
redis:
|
|
||||||
password: "Admin12345"
|
|
||||||
mongo:
|
|
||||||
password: "Admin12345"
|
|
||||||
|
|
||||||
tag: latest
|
|
||||||
-168
@@ -1,168 +0,0 @@
|
|||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# MixingX Helm Chart — values
|
|
||||||
# 架构:独立 DB + 四胞胎(agent/edge podAffinity) + 共享基础设施
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
|
|
||||||
# ── 全局 ──
|
|
||||||
registry: 192.168.1.105:8888/mixingx
|
|
||||||
tag: latest
|
|
||||||
|
|
||||||
# 时区(部署地域覆盖):中国 Asia/Shanghai,海外按需改如 America/New_York
|
|
||||||
# 注入所有容器的 TZ env,覆盖镜像内默认时区(镜像内置 Asia/Shanghai 兜底)
|
|
||||||
timezone: Asia/Shanghai
|
|
||||||
|
|
||||||
# ── 共享基础设施(所有服务连同一个) ──
|
|
||||||
sharedInfra:
|
|
||||||
postgres: # postgres 连接参数(每个独立 postgres 共用)
|
|
||||||
username: postgres
|
|
||||||
password: "Admin12345"
|
|
||||||
port: 5432
|
|
||||||
redis:
|
|
||||||
host: redis-service
|
|
||||||
port: 6379
|
|
||||||
password: "Admin12345"
|
|
||||||
rabbitmq:
|
|
||||||
host: messaging-service
|
|
||||||
port: 5672
|
|
||||||
username: guest
|
|
||||||
password: guest
|
|
||||||
mongo:
|
|
||||||
host: mongo-service
|
|
||||||
port: 27017
|
|
||||||
username: admin
|
|
||||||
password: "Admin12345"
|
|
||||||
database: mixingx_audit
|
|
||||||
otlp:
|
|
||||||
endpoint: http://k8s-dashboard-service:18889
|
|
||||||
protocol: grpc
|
|
||||||
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# 类型 A:四胞胎(agent/edge)— 后端+前端+独立DB,podAffinity 同节点
|
|
||||||
# 每个实例生成:后端 Deployment + 前端 Deployment + 独立 postgres StatefulSet
|
|
||||||
# 默认各 1 个,以后按需加(加一行 values + helm upgrade)
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# 点位配置 — 只写名字,模板自动推导其余字段
|
|
||||||
# 格式: agents/edges 元素可为字符串(老格式 "0")或对象(新格式 {site, nodeAffinity, nodeName})
|
|
||||||
# 生成规则:
|
|
||||||
# 后端: {role}-{site} 如 agent-0, agent-beijing
|
|
||||||
# 前端: {role}-web-{site} 如 agent-web-0, agent-web-beijing
|
|
||||||
# 数据库: {role}-db-{site} 如 agent-db-0, agent-db-beijing
|
|
||||||
# basePath: /{role}-{site} 如 /agent-0, /agent-beijing
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
|
|
||||||
agents:
|
|
||||||
- "0"
|
|
||||||
# - beijing
|
|
||||||
# - shanghai
|
|
||||||
|
|
||||||
edges:
|
|
||||||
- "0"
|
|
||||||
# - guangzhou
|
|
||||||
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# 节点档位调度(可选)— 按硬件能力把服务分配到相应 node
|
|
||||||
# 前提:给集群节点打 label kubectl label node <name> mixingx.io/tier=<infra|perf|edge>
|
|
||||||
# infra=基础设施级(最强) perf=性能级(中等) edge=边缘级(最弱)
|
|
||||||
# enabled=false 时完全不渲染调度(默认,向后兼容)
|
|
||||||
# 点位级覆盖:agents/edges 元素可用对象格式 {site, nodeName?, nodeAffinity?} 覆盖
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
tier:
|
|
||||||
enabled: false
|
|
||||||
nodeLabel: mixingx.io/tier
|
|
||||||
services:
|
|
||||||
gateway: { mode: required, tiers: [infra] }
|
|
||||||
sso: { mode: required, tiers: [infra] }
|
|
||||||
ultra: { mode: required, tiers: [infra] }
|
|
||||||
audit: { mode: required, tiers: [infra] }
|
|
||||||
sharedDatastores: { mode: required, tiers: [infra] }
|
|
||||||
agent: { mode: preferred, tiers: [perf, infra] }
|
|
||||||
edge: { mode: preferred, tiers: [edge, perf, infra] }
|
|
||||||
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# 类型 B:独立不亲和(sso/ultra)— 后端+前端+独立DB,无亲和,多副本
|
|
||||||
# 固定数量,不动态添加
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
standalones:
|
|
||||||
- name: sso
|
|
||||||
image: sso
|
|
||||||
role: sso
|
|
||||||
webName: sso-web
|
|
||||||
webImage: sso-web
|
|
||||||
webBasePath: /sso/
|
|
||||||
serviceId: sso
|
|
||||||
database: sso-db
|
|
||||||
pgStorage: 10Gi
|
|
||||||
description: "统一登录"
|
|
||||||
replicas: 2
|
|
||||||
affinity: false
|
|
||||||
|
|
||||||
- name: ultra
|
|
||||||
image: ultra
|
|
||||||
role: ultra
|
|
||||||
webName: ultra-web
|
|
||||||
webImage: ultra-web
|
|
||||||
webBasePath: /ultra/
|
|
||||||
database: ultra-db
|
|
||||||
pgStorage: 10Gi
|
|
||||||
description: "Ultra 看板"
|
|
||||||
replicas: 2
|
|
||||||
affinity: false
|
|
||||||
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
# 类型 C/D:无独立 DB 的服务
|
|
||||||
# ═══════════════════════════════════════════════════════════════
|
|
||||||
gateway:
|
|
||||||
image: gateway
|
|
||||||
port: 8080
|
|
||||||
replicas: 2
|
|
||||||
rbac: true # serviceAccountName: gateway-sa
|
|
||||||
|
|
||||||
audit:
|
|
||||||
enabled: true
|
|
||||||
image: audit
|
|
||||||
port: 5600
|
|
||||||
replicas: 2
|
|
||||||
|
|
||||||
# ── 共享数据层(非 postgres) ──
|
|
||||||
sharedDatastores:
|
|
||||||
- name: redis
|
|
||||||
image: docker.io/library/redis:8.6
|
|
||||||
port: 6379
|
|
||||||
storage: 2Gi
|
|
||||||
mountPath: /data
|
|
||||||
- name: mongo
|
|
||||||
image: docker.io/library/mongo:8.3
|
|
||||||
port: 27017
|
|
||||||
storage: 5Gi
|
|
||||||
mountPath: /data/db
|
|
||||||
- name: messaging
|
|
||||||
image: docker.io/library/rabbitmq:4.3-management
|
|
||||||
port: 5672
|
|
||||||
storage: 2Gi
|
|
||||||
mountPath: /var/lib/rabbitmq
|
|
||||||
|
|
||||||
# ── 协议模拟器(测试环境) ──
|
|
||||||
mocks:
|
|
||||||
- name: opcua-peripheral
|
|
||||||
image: opcua
|
|
||||||
port: 25006
|
|
||||||
scene: /scenes/opcua/peripheral-plc.json
|
|
||||||
- name: opcua-trimming
|
|
||||||
image: opcua
|
|
||||||
port: 25008
|
|
||||||
scene: /scenes/opcua/trimming-machine.json
|
|
||||||
- name: opcua-meter
|
|
||||||
image: opcua
|
|
||||||
port: 25010
|
|
||||||
scene: /scenes/opcua/meter.json
|
|
||||||
- name: s7-diecast
|
|
||||||
image: s7-diecast
|
|
||||||
port: 11021
|
|
||||||
|
|
||||||
# ── Ingress ──
|
|
||||||
ingress:
|
|
||||||
enabled: true
|
|
||||||
domain: app.mixingx.local
|
|
||||||
gatewayService: gateway-service # 所有流量 → gateway,由 gateway 动态路由
|
|
||||||
gatewayPort: 8080
|
|
||||||
Reference in new issue
Block a user