feat(edge-unit): 去 PostgreSQL + Edge Secret 只读挂载 + data PVC
This commit is contained in:
1 parent
08ed1422fe
commit
5d51b2e1de
9 files changed
+115
-104
No files matched your search
@@ -10,6 +10,8 @@
|
||||
replicas - 副本数(默认 1)
|
||||
serviceId - 业务身份(可选)
|
||||
database - 数据库名(有则生成 PG 连接串,指向 {name}-postgres-service)
|
||||
edgeData - Edge 本地配置修订 PVC(可选)
|
||||
edgeIdWorker - Edge Snowflake worker id(edgeData=true 时使用)
|
||||
rbac - 是否需要 serviceAccount(只有 gateway)
|
||||
description - 中文展示名(可选,写为 mixingx.io/description annotation)
|
||||
root - $ (root context)
|
||||
@@ -48,6 +50,17 @@ spec:
|
||||
{{- else }}
|
||||
{{ include "mixingx.tierAffinity" (dict "role" .role "root" .root) }}
|
||||
{{- end }}
|
||||
{{- if .edgeData }}
|
||||
volumes:
|
||||
- name: edge-data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .name }}-data
|
||||
{{- range $index, $secret := $root.Values.edgeSecrets.mounts }}
|
||||
- name: edge-secret-{{ $index }}
|
||||
secret:
|
||||
secretName: {{ required "edgeSecrets.mounts[].secretName is required" $secret.secretName | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .name }}
|
||||
image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }}
|
||||
@@ -65,12 +78,32 @@ spec:
|
||||
# 时区(部署地域覆盖,优先级 > 镜像内 /etc/localtime)
|
||||
- name: TZ
|
||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
||||
{{- if .edgeData }}
|
||||
- name: EdgeData__Root
|
||||
value: /var/lib/mixingx-edge
|
||||
- name: EdgeIdentity__NodeId
|
||||
value: {{ .name | quote }}
|
||||
- name: EdgeIdentity__IdWorkerId
|
||||
value: {{ .edgeIdWorker | quote }}
|
||||
- name: EdgeSecrets__Root
|
||||
value: {{ $root.Values.edgeSecrets.root | quote }}
|
||||
{{- end }}
|
||||
{{- if .rbac }}
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
{{- end }}
|
||||
{{- if .edgeData }}
|
||||
volumeMounts:
|
||||
- name: edge-data
|
||||
mountPath: /var/lib/mixingx-edge
|
||||
{{- range $index, $secret := $root.Values.edgeSecrets.mounts }}
|
||||
- name: edge-secret-{{ $index }}
|
||||
mountPath: {{ printf "%s/%s" $root.Values.edgeSecrets.root (required "edgeSecrets.mounts[].name is required" $secret.name) | quote }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
@@ -126,9 +159,11 @@ data:
|
||||
HTTP_PORTS: "{{ $port }}"
|
||||
REDIS_HOST: "{{ $root.Values.sharedInfra.redis.host }}"
|
||||
REDIS_PORT: "{{ $root.Values.sharedInfra.redis.port }}"
|
||||
{{- if .database }}
|
||||
POSTGRESQL_HOST: "{{ $pgHost }}"
|
||||
POSTGRESQL_PORT: "{{ $root.Values.sharedInfra.postgres.port }}"
|
||||
POSTGRESQL_USERNAME: "{{ $root.Values.sharedInfra.postgres.username }}"
|
||||
{{- end }}
|
||||
MESSAGING_HOST: "{{ $root.Values.sharedInfra.rabbitmq.host }}"
|
||||
MESSAGING_PORT: "{{ $root.Values.sharedInfra.rabbitmq.port }}"
|
||||
MESSAGING_USERNAME: "{{ $root.Values.sharedInfra.rabbitmq.username }}"
|
||||
|
||||
Reference in new issue
Block a user