- gateway-rbac 追加 gateway-prepull-manager Role/RoleBinding(daemonsets 增删查 + pods 只读,挂既有 gateway-sa):更新中心预拉取 DS 编排所需 - gateway Deployment 支持可选注入 gateway.updateCenter.argocdUrl / argocdTokenSecret → env Update__ArgoCd__*(缺省不注入 = 清单功能 503 降级)
141 lines
5.0 KiB
YAML
141 lines
5.0 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 }}
|
|
{{- /* 更新中心(ADR-0074):ArgoCD 只读访问(镜像清单);缺省不注入 = 清单功能 503 降级 */}}
|
|
{{- with .Values.gateway.updateCenter }}
|
|
{{- with .argocdUrl }}
|
|
- name: Update__ArgoCd__BaseUrl
|
|
value: {{ . | quote }}
|
|
{{- end }}
|
|
{{- with .argocdTokenSecret }}
|
|
- name: Update__ArgoCd__Token
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .name | quote }}
|
|
key: {{ .key | default "token" | quote }}
|
|
{{- end }}
|
|
{{- 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 }}"
|