| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- {{- 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.image.tag | default .Chart.AppVersion }}"
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- command:
- - sh
- - -c
- - java ${JAVA_OPTS} -jar /app/gateway.jar
-
- 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.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 }}
|