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