{{- if .Values.gateway.enabled }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "shop-recycle.fullname" . }}-gateway labels: app: {{ include "shop-recycle.fullname" . }}-gateway {{- include "shop-recycle.labels" . | nindent 4 }} namespace: {{ .Release.Namespace }} spec: replicas: {{ .Values.gateway.replicaCount }} selector: matchLabels: app: {{ include "shop-recycle.fullname" . }}-gateway {{- include "shop-recycle.selectorLabels" . | nindent 6 }} template: metadata: annotations: prometheus.io/scrape: "true" prometheus.io/port: "{{ .Values.gateway.containerPort }}" prometheus.io/path: "/actuator/prometheus" labels: app: {{ include "shop-recycle.fullname" . }}-gateway {{- include "shop-recycle.selectorLabels" . | nindent 8 }} spec: {{- if .Values.rbac.create }} serviceAccountName: {{ include "shop-recycle.serviceAccountName" . }} {{- end }} {{- if or .Values.global.registry.createSecret .Values.global.imagePullSecrets }} imagePullSecrets: {{- if .Values.global.registry.createSecret }} - name: {{ include "shop-recycle.fullname" . }}-registry-secret {{- end }} {{- with .Values.global.imagePullSecrets }} {{ toYaml . | indent 8 }} {{- end }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} containers: - name: gateway image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.gateway.image.name }}:{{ .Values.gateway.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.gateway.containerPort }} protocol: {{ .Values.gateway.protocol }} env: - name: SPRING_PROFILES_ACTIVE value: "{{ .Values.gateway.springProfiles }},{{ .Values.environment }}" - name: JAVA_OPTS value: "{{ .Values.gateway.javaOpts }}" - name: SPRING_CLOUD_CONFIG_SERVER_NATIVE_SEARCH_LOCATIONS value: "file:///etc/config" - name: SPRING_CONFIG_LOCATION value: "file:///etc/config/application.yml" - name: SPRING_MAIN_WEB_APPLICATION_TYPE value: "reactive" {{- range $key, $value := .Values.gateway.env }} - name: {{ $key }} value: "{{ $value }}" {{- end }} {{- if .Values.gateway.startupProbe }} startupProbe: {{- toYaml .Values.gateway.startupProbe | nindent 12 }} {{- end }} {{- if .Values.gateway.livenessProbe }} livenessProbe: {{- toYaml .Values.gateway.livenessProbe | nindent 12 }} {{- end }} {{- if .Values.gateway.readinessProbe }} readinessProbe: {{- toYaml .Values.gateway.readinessProbe | nindent 12 }} {{- end }} resources: {{- toYaml .Values.gateway.resources | nindent 12 }} volumeMounts: - name: config mountPath: /etc/config - name: logs mountPath: /app/logs volumes: - name: config configMap: name: {{ include "shop-recycle.fullname" . }}-gateway-config - name: logs emptyDir: {} {{- end }}