Tasks 10-11: podAffinity+nodeAffinity 合并到同一 affinity 块; audit/shared-infra 走 tier;Chart.yaml 1.1.0→1.2.0。
67 lines
2.2 KiB
YAML
67 lines
2.2 KiB
YAML
{{- 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 }}
|