{{- if .Values.paymentService.enabled }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "shop-recycle.fullname" . }}-payment-service labels: app: {{ include "shop-recycle.fullname" . }}-payment-service {{- include "shop-recycle.labels" . | nindent 4 }} namespace: {{ .Release.Namespace }} spec: replicas: {{ .Values.paymentService.replicaCount }} selector: matchLabels: app: {{ include "shop-recycle.fullname" . }}-payment-service {{- include "shop-recycle.selectorLabels" . | nindent 6 }} template: metadata: annotations: prometheus.io/scrape: "true" prometheus.io/port: "{{ .Values.paymentService.containerPort }}" prometheus.io/path: "/actuator/prometheus" labels: app: {{ include "shop-recycle.fullname" . }}-payment-service {{- 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: payment-service image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.paymentService.image.name }}:{{ .Values.paymentService.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.paymentService.containerPort }} protocol: {{ .Values.paymentService.protocol }} env: - name: SPRING_PROFILES_ACTIVE value: "{{ .Values.paymentService.springProfiles }},{{ .Values.environment }}" - name: JAVA_OPTS value: "{{ .Values.paymentService.javaOpts }}" {{- range $key, $value := .Values.paymentService.env }} - name: {{ $key }} value: "{{ $value }}" {{- end }} {{- if .Values.paymentService.startupProbe }} startupProbe: {{- toYaml .Values.paymentService.startupProbe | nindent 12 }} {{- end }} {{- if .Values.paymentService.livenessProbe }} livenessProbe: {{- toYaml .Values.paymentService.livenessProbe | nindent 12 }} {{- end }} {{- if .Values.paymentService.readinessProbe }} readinessProbe: {{- toYaml .Values.paymentService.readinessProbe | nindent 12 }} {{- end }} resources: {{- toYaml .Values.paymentService.resources | nindent 12 }} volumeMounts: - name: logs mountPath: /app/logs volumes: - name: logs emptyDir: {} {{- end }}