feat(chart): instances/standalones 改 range 循环 + 全部镜像加时区
== helm chart 标准化 == - instances/standalones: 写死文件 → range 循环(加/删点位只改 values) - values 加 webName(显式前端名)+ description(Gateway 中文展示名) - _backend.tpl: Service 加 mixingx.io/description annotation + 补 ultra serviceId - _frontend.tpl/audit.yaml/mock.yaml: 注入 TZ env - values 加 timezone 变量(部署地域可覆盖,默认 Asia/Shanghai) - 修 app-ingress.yaml gatewayService/gatewayPort undefined bug - 验证: helm diff 资源数一致(61=61),加 agent-beijing 点位 8 资源全部正确生成 == 12 个 Dockerfile 加时区 == 后端(.NET debian): apt-get tzdata + ln /etc/localtime + ENV TZ 前端(nginx alpine): apk add tzdata audit(node alpine): apk add tzdata mock(opcua/s7): 同上 镜像内置 Asia/Shanghai 兜底 + helm TZ env 覆盖 = 双保险 == submodule Dockerfile 重写 == agent/edge/ultra: 重写适配 hub 根 context(含 ServiceDefaults 跨仓库引用) sso/gateway: 加时区 == submodule 指针更新 == 7 个 submodule 指针全部更新
This commit is contained in:
1 parent
f69c4161b5
commit
8ffc6ee825
11 files changed
+85
-50
No files matched your search
+12
-2
@@ -11,6 +11,7 @@
|
||||
serviceId - 业务身份(可选)
|
||||
database - 数据库名(有则生成 PG 连接串,指向 {name}-postgres-service)
|
||||
rbac - 是否需要 serviceAccount(只有 gateway)
|
||||
description - 中文展示名(可选,写为 mixingx.io/description annotation)
|
||||
root - $ (root context)
|
||||
*/}}
|
||||
{{- define "mixingx.backend" -}}
|
||||
@@ -53,13 +54,16 @@ spec:
|
||||
name: {{ .name }}-config
|
||||
- secretRef:
|
||||
name: {{ .name }}-secrets
|
||||
{{- if .rbac }}
|
||||
env:
|
||||
# 时区(部署地域覆盖,优先级 > 镜像内 /etc/localtime)
|
||||
- name: TZ
|
||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
||||
{{- if .rbac }}
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
@@ -88,6 +92,10 @@ metadata:
|
||||
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 }}
|
||||
@@ -123,6 +131,8 @@ data:
|
||||
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 }}"
|
||||
|
||||
@@ -52,6 +52,9 @@ spec:
|
||||
containerPort: {{ $port }}
|
||||
protocol: TCP
|
||||
env:
|
||||
# 时区(部署地域覆盖,优先级 > 镜像内 /etc/localtime)
|
||||
- name: TZ
|
||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
||||
- name: VITE_BASE_PATH
|
||||
value: "{{ .basePath }}"
|
||||
- name: PORT
|
||||
|
||||
@@ -27,6 +27,9 @@ spec:
|
||||
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
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{{/*
|
||||
agent-0 四胞胎:后端 + 前端 + 独立 postgres(三者 podAffinity 同节点)
|
||||
*/}}
|
||||
{{- $root := $ }}
|
||||
# 1. 后端
|
||||
{{ include "mixingx.backend" (dict "name" "agent-0" "image" "agent" "role" "agent" "serviceId" "agent-0" "database" "agent-db-0" "root" $root) }}
|
||||
|
||||
# 2. 前端(亲和到 agent-0)
|
||||
{{ include "mixingx.frontend" (dict "name" "agent-web-0" "image" "agent-web" "basePath" "/agent-0/" "affinity" "agent-0" "root" $root) }}
|
||||
|
||||
# 3. 独立 postgres(亲和到 agent-0)
|
||||
{{ include "mixingx.postgres" (dict "name" "agent-0" "database" "agent-db-0" "pgStorage" "5Gi" "affinity" true "root" $root) }}
|
||||
@@ -1,12 +0,0 @@
|
||||
{{/*
|
||||
edge-0 四胞胎:后端 + 前端 + 独立 postgres(三者 podAffinity 同节点)
|
||||
*/}}
|
||||
{{- $root := $ }}
|
||||
# 1. 后端
|
||||
{{ include "mixingx.backend" (dict "name" "edge-0" "image" "edge" "role" "edge" "serviceId" "edge-0" "database" "edge-db-0" "root" $root) }}
|
||||
|
||||
# 2. 前端(亲和到 edge-0)
|
||||
{{ include "mixingx.frontend" (dict "name" "edge-web-0" "image" "edge-web" "basePath" "/edge-0/" "affinity" "edge-0" "root" $root) }}
|
||||
|
||||
# 3. 独立 postgres(亲和到 edge-0)
|
||||
{{ include "mixingx.postgres" (dict "name" "edge-0" "database" "edge-db-0" "pgStorage" "5Gi" "affinity" true "root" $root) }}
|
||||
@@ -0,0 +1,18 @@
|
||||
{{/*
|
||||
四胞胎实例(agent/edge)— 遍历 values.instances 数组
|
||||
每个实例生成:后端 Deployment + 前端 Deployment + 独立 postgres StatefulSet(三者 podAffinity 同节点)
|
||||
|
||||
加/删点位:只改 values.yaml 的 instances 数组,helm upgrade 自动生效。
|
||||
*/}}
|
||||
{{- range $inst := .Values.instances }}
|
||||
{{- $root := $ }}
|
||||
# ═══ 实例: {{ $inst.name }} ({{ $inst.description }}) ═══
|
||||
# 1. 后端
|
||||
{{ include "mixingx.backend" (dict "name" $inst.name "image" $inst.image "role" $inst.role "serviceId" $inst.serviceId "database" $inst.database "description" $inst.description "root" $root) }}
|
||||
|
||||
# 2. 前端(亲和到后端同节点)
|
||||
{{ include "mixingx.frontend" (dict "name" $inst.webName "image" $inst.webImage "basePath" $inst.webBasePath "affinity" $inst.name "root" $root) }}
|
||||
|
||||
# 3. 独立 postgres(亲和到后端同节点)
|
||||
{{ include "mixingx.postgres" (dict "name" $inst.name "database" $inst.database "pgStorage" $inst.pgStorage "affinity" true "root" $root) }}
|
||||
{{- end }}
|
||||
@@ -36,6 +36,10 @@ spec:
|
||||
- name: tcp
|
||||
containerPort: {{ .port }}
|
||||
protocol: TCP
|
||||
env:
|
||||
# 时区(部署地域覆盖)
|
||||
- name: TZ
|
||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{{/*
|
||||
sso:后端(×2 副本) + 前端 + 独立 postgres(无亲和)
|
||||
*/}}
|
||||
{{- $root := $ }}
|
||||
# 1. 后端(×2)
|
||||
{{ include "mixingx.backend" (dict "name" "sso" "image" "sso" "role" "sso" "replicas" 2 "serviceId" "sso" "database" "sso-db" "root" $root) }}
|
||||
|
||||
# 2. 前端(无亲和)
|
||||
{{ include "mixingx.frontend" (dict "name" "sso-web" "image" "sso-web" "basePath" "/sso/" "root" $root) }}
|
||||
|
||||
# 3. 独立 postgres(无亲和)
|
||||
{{ include "mixingx.postgres" (dict "name" "sso" "database" "sso-db" "pgStorage" "10Gi" "affinity" false "root" $root) }}
|
||||
@@ -1,12 +0,0 @@
|
||||
{{/*
|
||||
ultra:后端(×2 副本) + 前端 + 独立 postgres(无亲和)
|
||||
*/}}
|
||||
{{- $root := $ }}
|
||||
# 1. 后端(×2)
|
||||
{{ include "mixingx.backend" (dict "name" "ultra" "image" "ultra" "role" "ultra" "replicas" 2 "database" "ultra-db" "root" $root) }}
|
||||
|
||||
# 2. 前端
|
||||
{{ include "mixingx.frontend" (dict "name" "ultra-web" "image" "ultra-web" "basePath" "/ultra/" "root" $root) }}
|
||||
|
||||
# 3. 独立 postgres
|
||||
{{ include "mixingx.postgres" (dict "name" "ultra" "database" "ultra-db" "pgStorage" "10Gi" "affinity" false "root" $root) }}
|
||||
@@ -0,0 +1,18 @@
|
||||
{{/*
|
||||
独立实例(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. 前端(无亲和)
|
||||
{{ include "mixingx.frontend" (dict "name" $inst.webName "image" $inst.webImage "basePath" $inst.webBasePath "root" $root) }}
|
||||
|
||||
# 3. 独立 postgres(无亲和)
|
||||
{{ include "mixingx.postgres" (dict "name" $inst.name "database" $inst.database "pgStorage" $inst.pgStorage "affinity" false "root" $root) }}
|
||||
{{- end }}
|
||||
Reference in new issue
Block a user