Files
ximenchuifeng 601151bfae feat(delivery): 全 chart 支持 imagePullSecrets(默认空,内网零变化)+ 交付镜像清单
- 10 个 chart values 顶层加 imagePullSecrets: [](ADR-0066)
- 27 处 Pod spec 注入 with 块;platform _workloads.tpl 用 $root 上下文
- 默认渲染与改动前 bit 级一致(helm template 验证);注入测试 10/10 通过
- delivery/image-manifest.yaml: 第三方镜像 ACR 核对清单(nanomq 为当前缺口)
2026-08-22 13:06:46 +08:00

127 lines
4.4 KiB
YAML

{{- $gatewayImage := .Values.images.gateway -}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gateway-deployment
labels:
app.kubernetes.io/name: mixingx
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: gateway
mixingx.io/role: gateway
mixingx.io/node-id: gateway
spec:
replicas: {{ .Values.gateway.replicas | default 2 }}
selector:
matchLabels:
app.kubernetes.io/component: gateway
template:
metadata:
labels:
app.kubernetes.io/component: gateway
mixingx.io/role: gateway
mixingx.io/node-id: gateway
spec:
{{- if .Values.gateway.rbac }}
serviceAccountName: gateway-sa
{{- end }}
{{ include "mixingx-gateway.tierAffinity" (dict "role" "gateway" "root" $) | nindent 6 }}
{{- with $.Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: gateway
image: {{ .Values.registry }}/{{ $gatewayImage.repository | default "gateway" }}:{{ $gatewayImage.tag | default .Values.tag | default "latest" }}
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: {{ .Values.gateway.port | default 8080 }}
protocol: TCP
envFrom:
- configMapRef:
name: gateway-config
- secretRef:
name: gateway-secrets
env:
- name: TZ
value: "{{ .Values.timezone | default "Asia/Shanghai" }}"
{{- if .Values.gateway.rbac }}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- end }}
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 120
periodSeconds: 30
timeoutSeconds: 15
failureThreshold: 12
readinessProbe:
httpGet:
path: /alive
port: http
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 8
---
apiVersion: v1
kind: Service
metadata:
name: gateway-service
labels:
app.kubernetes.io/name: mixingx
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: gateway
mixingx.io/role: gateway
mixingx.io/node-id: gateway
spec:
selector:
app.kubernetes.io/component: gateway
ports:
- name: http
port: {{ .Values.gateway.port | default 8080 }}
targetPort: http
protocol: TCP
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gateway-config
labels:
app.kubernetes.io/name: mixingx
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: gateway
data:
HTTP_PORTS: "{{ .Values.gateway.port | default 8080 }}"
REDIS_HOST: "{{ .Values.sharedInfra.redis.host }}"
REDIS_PORT: "{{ .Values.sharedInfra.redis.port }}"
MESSAGING_HOST: "{{ .Values.sharedInfra.rabbitmq.host }}"
MESSAGING_PORT: "{{ .Values.sharedInfra.rabbitmq.port }}"
MESSAGING_USERNAME: "{{ .Values.sharedInfra.rabbitmq.username }}"
OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.sharedInfra.otlp.endpoint }}"
OTEL_EXPORTER_OTLP_PROTOCOL: "{{ .Values.sharedInfra.otlp.protocol }}"
OTEL_SERVICE_NAME: "gateway"
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
---
apiVersion: v1
kind: Secret
metadata:
name: gateway-secrets
labels:
app.kubernetes.io/name: mixingx
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: gateway
type: Opaque
stringData:
ConnectionStrings__redis: "{{ .Values.sharedInfra.redis.host }}:{{ .Values.sharedInfra.redis.port }},password={{ .Values.sharedInfra.redis.password }}"
REDIS_PASSWORD: "{{ .Values.sharedInfra.redis.password }}"
REDIS_URI: "redis://:{{ .Values.sharedInfra.redis.password }}@{{ .Values.sharedInfra.redis.host }}:{{ .Values.sharedInfra.redis.port }}"
ConnectionStrings__messaging: "amqp://{{ .Values.sharedInfra.rabbitmq.username }}:{{ .Values.sharedInfra.rabbitmq.password }}@{{ .Values.sharedInfra.rabbitmq.host }}:{{ .Values.sharedInfra.rabbitmq.port }}"
MESSAGING_PASSWORD: "{{ .Values.sharedInfra.rabbitmq.password }}"
MESSAGING_URI: "amqp://{{ .Values.sharedInfra.rabbitmq.username }}:{{ .Values.sharedInfra.rabbitmq.password }}@{{ .Values.sharedInfra.rabbitmq.host }}:{{ .Values.sharedInfra.rabbitmq.port }}"