Merge commit '6fcb034'
This commit is contained in:
commit
e65e1f0654
5 files changed
+358
-33
No files matched your search
@@ -8,20 +8,15 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: mixingx
|
app.kubernetes.io/name: mixingx
|
||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
mixingx.io/role: audit
|
|
||||||
mixingx.io/node-id: audit
|
|
||||||
spec:
|
spec:
|
||||||
replicas: {{ .Values.audit.replicas | default 1 }}
|
replicas: {{ .Values.audit.replicas | default 2 }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
mixingx.io/role: audit
|
|
||||||
mixingx.io/node-id: audit
|
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
containers:
|
containers:
|
||||||
@@ -35,20 +30,76 @@ spec:
|
|||||||
env:
|
env:
|
||||||
- name: TZ
|
- name: TZ
|
||||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
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
|
- name: PORT
|
||||||
value: "{{ .Values.audit.port }}"
|
value: "{{ .Values.audit.port }}"
|
||||||
- name: HOST
|
- name: HOST
|
||||||
value: "0.0.0.0"
|
value: "0.0.0.0"
|
||||||
|
# PostgreSQL — 凭据通过 Secret 注入
|
||||||
|
- name: AUDIT_PG_URI
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: audit-secrets
|
||||||
|
key: AUDIT_PG_URI
|
||||||
|
- name: AUDIT_PG_TIMEZONE
|
||||||
|
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
||||||
|
# MQTT broker
|
||||||
|
- name: AUDIT_MQTT_BROKER_URL
|
||||||
|
value: "mqtt://{{ .Values.audit.mqtt.brokerHost }}:{{ .Values.audit.mqtt.brokerPort }}"
|
||||||
|
# POD_NAME 供 config.ts 自动生成 mixingx-audit-sub-{podName} clientId
|
||||||
|
- name: POD_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.name
|
||||||
|
- name: AUDIT_MQTT_SHARED_GROUP
|
||||||
|
value: "mixingx-audit"
|
||||||
|
# NanoMQ 管理 API — 凭据通过 Secret 注入
|
||||||
|
- name: AUDIT_MQTT_MANAGEMENT_URL
|
||||||
|
value: "http://{{ .Values.audit.mqtt.brokerHost }}:{{ .Values.audit.mqtt.managementPort }}"
|
||||||
|
- name: AUDIT_MQTT_MANAGEMENT_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: audit-secrets
|
||||||
|
key: AUDIT_MQTT_MANAGEMENT_USERNAME
|
||||||
|
- name: AUDIT_MQTT_MANAGEMENT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: audit-secrets
|
||||||
|
key: AUDIT_MQTT_MANAGEMENT_PASSWORD
|
||||||
|
# 消费队列/并发
|
||||||
|
- name: AUDIT_CONSUME_QUEUE_CAPACITY
|
||||||
|
value: "{{ .Values.audit.consume.queueCapacity }}"
|
||||||
|
- name: AUDIT_CONSUME_QUEUE_MAX_WAIT_MS
|
||||||
|
value: "{{ .Values.audit.consume.queueMaxWaitMs }}"
|
||||||
|
- name: AUDIT_DB_WRITE_TIMEOUT_MS
|
||||||
|
value: "{{ .Values.audit.consume.dbWriteTimeoutMs }}"
|
||||||
|
- name: AUDIT_CONSUME_CONCURRENCY
|
||||||
|
value: "{{ .Values.audit.consume.concurrency }}"
|
||||||
|
# JWT
|
||||||
|
- name: JWT_ISSUER
|
||||||
|
value: "{{ .Values.audit.jwt.issuer }}"
|
||||||
|
- name: JWT_AUDIENCE
|
||||||
|
value: "{{ .Values.audit.jwt.audience }}"
|
||||||
|
- name: JWT_JWKS_URI
|
||||||
|
value: "{{ .Values.audit.jwt.jwksUri }}"
|
||||||
|
# OpenTelemetry
|
||||||
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
||||||
value: "{{ .Values.sharedInfra.otlp.endpoint }}"
|
value: "{{ $root.Values.sharedInfra.otlp.endpoint }}"
|
||||||
- name: OTEL_SERVICE_NAME
|
- name: OTEL_SERVICE_NAME
|
||||||
value: "audit"
|
value: "audit"
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health/live
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health/ready
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
@@ -67,4 +118,18 @@ spec:
|
|||||||
port: {{ .Values.audit.port }}
|
port: {{ .Values.audit.port }}
|
||||||
targetPort: http
|
targetPort: http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
---
|
||||||
|
# ===== Audit Secrets =====
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: audit-secrets
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mixingx
|
||||||
|
app.kubernetes.io/component: audit
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
AUDIT_PG_URI: "postgresql://{{ $root.Values.sharedInfra.postgres.username }}:{{ $root.Values.sharedInfra.postgres.password }}@{{ .Values.audit.database }}-postgres-service:{{ $root.Values.sharedInfra.postgres.port }}/{{ .Values.audit.database }}"
|
||||||
|
AUDIT_MQTT_MANAGEMENT_USERNAME: "{{ .Values.audit.mqtt.managementUsername }}"
|
||||||
|
AUDIT_MQTT_MANAGEMENT_PASSWORD: "{{ .Values.audit.mqtt.managementPassword }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -3,25 +3,39 @@ tag: latest
|
|||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
|
||||||
sharedInfra:
|
sharedInfra:
|
||||||
mongo:
|
postgres:
|
||||||
host: mongo-service
|
image: docker.io/library/postgres:17
|
||||||
port: 27017
|
username: postgres
|
||||||
username: admin
|
|
||||||
password: "Admin12345"
|
password: "Admin12345"
|
||||||
database: mixingx_audit
|
port: 5432
|
||||||
rabbitmq:
|
|
||||||
host: messaging-service
|
|
||||||
port: 5672
|
|
||||||
username: guest
|
|
||||||
password: guest
|
|
||||||
otlp:
|
otlp:
|
||||||
endpoint: http://k8s-dashboard-service:18889
|
endpoint: http://k8s-dashboard-service:18889
|
||||||
protocol: grpc
|
protocol: grpc
|
||||||
|
|
||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
port: 5600
|
port: 5900
|
||||||
replicas: 2
|
replicas: 2
|
||||||
|
database: audit-db
|
||||||
|
pgStorage: 5Gi
|
||||||
|
# MQTT broker (中心 Audit NanoMQ)
|
||||||
|
mqtt:
|
||||||
|
brokerHost: "audit-nanomq-service"
|
||||||
|
brokerPort: 1883
|
||||||
|
managementPort: 8081
|
||||||
|
managementUsername: "admin"
|
||||||
|
managementPassword: "public"
|
||||||
|
# JWT 鉴权(通过 SSO JWKS)
|
||||||
|
jwt:
|
||||||
|
issuer: "mixingx-sso"
|
||||||
|
audience: "mixingx-audit"
|
||||||
|
jwksUri: "http://sso-service:5100/.well-known/jwks.json"
|
||||||
|
# 消费队列/并发配置
|
||||||
|
consume:
|
||||||
|
queueCapacity: 128
|
||||||
|
queueMaxWaitMs: 5000
|
||||||
|
dbWriteTimeoutMs: 3000
|
||||||
|
concurrency: 4
|
||||||
|
|
||||||
images:
|
images:
|
||||||
audit:
|
audit:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{{- if .Values.audit.enabled }}
|
{{- if .Values.audit.enabled }}
|
||||||
{{- $root := $ }}
|
{{- $root := $ }}
|
||||||
---
|
---
|
||||||
|
# ===== Audit 后端 (Node.js/Fastify, 端口 5900) =====
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -9,7 +10,7 @@ metadata:
|
|||||||
app.kubernetes.io/name: mixingx
|
app.kubernetes.io/name: mixingx
|
||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
spec:
|
spec:
|
||||||
replicas: {{ .Values.audit.replicas | default 1 }}
|
replicas: {{ .Values.audit.replicas | default 2 }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
@@ -30,20 +31,76 @@ spec:
|
|||||||
env:
|
env:
|
||||||
- name: TZ
|
- name: TZ
|
||||||
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
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
|
- name: PORT
|
||||||
value: "{{ .Values.audit.port }}"
|
value: "{{ .Values.audit.port }}"
|
||||||
- name: HOST
|
- name: HOST
|
||||||
value: "0.0.0.0"
|
value: "0.0.0.0"
|
||||||
|
# PostgreSQL (Audit 数据) — 凭据通过 Secret 注入
|
||||||
|
- name: AUDIT_PG_URI
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: audit-secrets
|
||||||
|
key: AUDIT_PG_URI
|
||||||
|
- name: AUDIT_PG_TIMEZONE
|
||||||
|
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
||||||
|
# MQTT broker (中心 audit-nanomq)
|
||||||
|
- name: AUDIT_MQTT_BROKER_URL
|
||||||
|
value: "mqtt://{{ .Values.audit.mqtt.brokerHost }}:{{ .Values.audit.mqtt.brokerPort }}"
|
||||||
|
# POD_NAME 供 config.ts 自动生成 mixingx-audit-sub-{podName} clientId
|
||||||
|
- name: POD_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.name
|
||||||
|
- name: AUDIT_MQTT_SHARED_GROUP
|
||||||
|
value: "mixingx-audit"
|
||||||
|
# NanoMQ 管理 API (用于状态聚合) — 凭据通过 Secret 注入
|
||||||
|
- name: AUDIT_MQTT_MANAGEMENT_URL
|
||||||
|
value: "http://{{ .Values.audit.mqtt.brokerHost }}:{{ .Values.audit.mqtt.managementPort }}"
|
||||||
|
- name: AUDIT_MQTT_MANAGEMENT_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: audit-secrets
|
||||||
|
key: AUDIT_MQTT_MANAGEMENT_USERNAME
|
||||||
|
- name: AUDIT_MQTT_MANAGEMENT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: audit-secrets
|
||||||
|
key: AUDIT_MQTT_MANAGEMENT_PASSWORD
|
||||||
|
# 消费队列/并发配置
|
||||||
|
- name: AUDIT_CONSUME_QUEUE_CAPACITY
|
||||||
|
value: "128"
|
||||||
|
- name: AUDIT_CONSUME_QUEUE_MAX_WAIT_MS
|
||||||
|
value: "5000"
|
||||||
|
- name: AUDIT_DB_WRITE_TIMEOUT_MS
|
||||||
|
value: "3000"
|
||||||
|
- name: AUDIT_CONSUME_CONCURRENCY
|
||||||
|
value: "4"
|
||||||
|
# JWT 鉴权 (SSO JWKS)
|
||||||
|
- name: JWT_ISSUER
|
||||||
|
value: "{{ .Values.audit.jwt.issuer }}"
|
||||||
|
- name: JWT_AUDIENCE
|
||||||
|
value: "{{ .Values.audit.jwt.audience }}"
|
||||||
|
- name: JWT_JWKS_URI
|
||||||
|
value: "http://sso-service:5100/.well-known/jwks.json"
|
||||||
|
# OpenTelemetry
|
||||||
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
||||||
value: "{{ .Values.sharedInfra.otlp.endpoint }}"
|
value: "{{ $root.Values.sharedInfra.otlp.endpoint }}"
|
||||||
- name: OTEL_SERVICE_NAME
|
- name: OTEL_SERVICE_NAME
|
||||||
value: "audit"
|
value: "audit"
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health/live
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health/ready
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
@@ -54,6 +111,8 @@ metadata:
|
|||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
mixingx.io/role: audit
|
mixingx.io/role: audit
|
||||||
mixingx.io/node-id: audit
|
mixingx.io/node-id: audit
|
||||||
|
annotations:
|
||||||
|
mixingx.io/description: "审计服务"
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
@@ -62,4 +121,139 @@ spec:
|
|||||||
port: {{ .Values.audit.port }}
|
port: {{ .Values.audit.port }}
|
||||||
targetPort: http
|
targetPort: http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
---
|
||||||
|
# ===== Audit 前端 (nginx, 端口 8900) =====
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.audit.webName }}-deployment
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mixingx
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.webName }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.audit.replicas | default 2 }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.webName }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.webName }}
|
||||||
|
spec:
|
||||||
|
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
|
containers:
|
||||||
|
- name: {{ .Values.audit.webName }}
|
||||||
|
image: "{{ .Values.registry }}/{{ .Values.audit.webImage }}:{{ .Values.tag | default "latest" }}"
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: {{ .Values.audit.webPort }}
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: "{{ $root.Values.timezone | default "Asia/Shanghai" }}"
|
||||||
|
- name: VITE_BASE_PATH
|
||||||
|
value: "{{ .Values.audit.webBasePath }}"
|
||||||
|
- name: PORT
|
||||||
|
value: "{{ .Values.audit.webPort }}"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.audit.webName }}-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mixingx
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.webName }}
|
||||||
|
mixingx.io/role: web
|
||||||
|
mixingx.io/node-id: {{ .Values.audit.webName }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.webName }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: {{ .Values.audit.webPort }}
|
||||||
|
targetPort: http
|
||||||
|
protocol: TCP
|
||||||
|
---
|
||||||
|
# ===== Audit PostgreSQL =====
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.audit.database }}-postgres
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mixingx
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
||||||
|
spec:
|
||||||
|
serviceName: {{ .Values.audit.database }}-postgres-service
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
annotations:
|
||||||
|
helm.sh/resource-policy: keep
|
||||||
|
spec:
|
||||||
|
accessModes: ["ReadWriteOnce"]
|
||||||
|
storageClassName: {{ include "mixingx-platform.storageClassName" $root }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.audit.pgStorage }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
||||||
|
spec:
|
||||||
|
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
|
containers:
|
||||||
|
- name: postgres
|
||||||
|
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
env:
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
value: "{{ $root.Values.sharedInfra.postgres.password }}"
|
||||||
|
- name: POSTGRES_DB
|
||||||
|
value: "{{ .Values.audit.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
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.audit.database }}-postgres-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mixingx
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
||||||
|
ports:
|
||||||
|
- name: tcp
|
||||||
|
port: {{ $root.Values.sharedInfra.postgres.port }}
|
||||||
|
targetPort: tcp
|
||||||
|
protocol: TCP
|
||||||
|
---
|
||||||
|
# ===== Audit Secrets =====
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: audit-secrets
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mixingx
|
||||||
|
app.kubernetes.io/component: audit
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
AUDIT_PG_URI: "postgresql://{{ $root.Values.sharedInfra.postgres.username }}:{{ $root.Values.sharedInfra.postgres.password }}@{{ .Values.audit.database }}-postgres-service:{{ $root.Values.sharedInfra.postgres.port }}/{{ .Values.audit.database }}"
|
||||||
|
AUDIT_MQTT_MANAGEMENT_USERNAME: "{{ .Values.audit.mqtt.managementUsername }}"
|
||||||
|
AUDIT_MQTT_MANAGEMENT_PASSWORD: "{{ .Values.audit.mqtt.managementPassword }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -59,6 +59,25 @@ spec:
|
|||||||
- name: RABBITMQ_DEFAULT_PASS
|
- name: RABBITMQ_DEFAULT_PASS
|
||||||
value: "{{ $root.Values.sharedInfra.rabbitmq.password }}"
|
value: "{{ $root.Values.sharedInfra.rabbitmq.password }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if eq .name "audit-nanomq" }}
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args:
|
||||||
|
- "-c"
|
||||||
|
- |
|
||||||
|
cat > /etc/nanomq.conf <<EOF
|
||||||
|
mqtt {
|
||||||
|
allow_anonymous = true
|
||||||
|
max_mqueue_len = 128
|
||||||
|
}
|
||||||
|
http_server {
|
||||||
|
enable = true
|
||||||
|
port = 8081
|
||||||
|
username = {{ $root.Values.audit.mqtt.managementUsername }}
|
||||||
|
password = {{ $root.Values.audit.mqtt.managementPassword }}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
exec nanomq start --conf /etc/nanomq.conf
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: {{ .mountPath }}
|
mountPath: {{ .mountPath }}
|
||||||
@@ -84,4 +103,14 @@ spec:
|
|||||||
targetPort: 15672
|
targetPort: 15672
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if eq .name "audit-nanomq" }}
|
||||||
|
- name: mqtt
|
||||||
|
port: {{ $root.Values.audit.mqtt.brokerPort }}
|
||||||
|
targetPort: {{ $root.Values.audit.mqtt.brokerPort }}
|
||||||
|
protocol: TCP
|
||||||
|
- name: management
|
||||||
|
port: {{ $root.Values.audit.mqtt.managementPort }}
|
||||||
|
targetPort: {{ $root.Values.audit.mqtt.managementPort }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -74,8 +74,25 @@ gateway:
|
|||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
image: audit
|
image: audit
|
||||||
port: 5600
|
port: 5900
|
||||||
replicas: 2
|
replicas: 2
|
||||||
|
webName: audit-web
|
||||||
|
webImage: audit-web
|
||||||
|
webBasePath: /audit/
|
||||||
|
webPort: 8900
|
||||||
|
database: audit-db
|
||||||
|
pgStorage: 5Gi
|
||||||
|
# MQTT broker (中心 Audit NanoMQ)
|
||||||
|
mqtt:
|
||||||
|
brokerHost: "audit-nanomq-service"
|
||||||
|
brokerPort: 1883
|
||||||
|
managementPort: 8081
|
||||||
|
managementUsername: "admin"
|
||||||
|
managementPassword: "public"
|
||||||
|
# JWT 鉴权(通过 SSO JWKS)
|
||||||
|
jwt:
|
||||||
|
issuer: "mixingx-sso"
|
||||||
|
audience: "mixingx-audit"
|
||||||
|
|
||||||
sharedDatastores:
|
sharedDatastores:
|
||||||
- name: redis
|
- name: redis
|
||||||
@@ -93,6 +110,12 @@ sharedDatastores:
|
|||||||
port: 5672
|
port: 5672
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
mountPath: /var/lib/rabbitmq
|
mountPath: /var/lib/rabbitmq
|
||||||
|
- name: audit-nanomq
|
||||||
|
image: emqx/nanomq:0.25.2-2
|
||||||
|
port: 1883
|
||||||
|
storage: 1Gi
|
||||||
|
mountPath: /var/lib/nanomq
|
||||||
|
managementPort: 8081
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
Reference in new issue
Block a user