{{- $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 }} 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 }}"