deployment-payment-service.yaml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {{- if .Values.paymentService.enabled }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ include "shop-recycle.fullname" . }}-payment-service
  6. labels:
  7. app: {{ include "shop-recycle.fullname" . }}-payment-service
  8. {{- include "shop-recycle.labels" . | nindent 4 }}
  9. namespace: {{ .Release.Namespace }}
  10. spec:
  11. replicas: {{ .Values.paymentService.replicaCount }}
  12. selector:
  13. matchLabels:
  14. app: {{ include "shop-recycle.fullname" . }}-payment-service
  15. {{- include "shop-recycle.selectorLabels" . | nindent 6 }}
  16. template:
  17. metadata:
  18. annotations:
  19. prometheus.io/scrape: "true"
  20. prometheus.io/port: "{{ .Values.paymentService.containerPort }}"
  21. prometheus.io/path: "/actuator/prometheus"
  22. labels:
  23. app: {{ include "shop-recycle.fullname" . }}-payment-service
  24. {{- include "shop-recycle.selectorLabels" . | nindent 8 }}
  25. spec:
  26. {{- if .Values.rbac.create }}
  27. serviceAccountName: {{ include "shop-recycle.serviceAccountName" . }}
  28. {{- end }}
  29. {{- with .Values.affinity }}
  30. affinity:
  31. {{- toYaml . | nindent 8 }}
  32. {{- end }}
  33. {{- with .Values.tolerations }}
  34. tolerations:
  35. {{- toYaml . | nindent 8 }}
  36. {{- end }}
  37. containers:
  38. - name: payment-service
  39. image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.paymentService.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  40. imagePullPolicy: {{ .Values.image.pullPolicy }}
  41. ports:
  42. - name: http
  43. containerPort: {{ .Values.paymentService.containerPort }}
  44. protocol: {{ .Values.paymentService.protocol }}
  45. env:
  46. - name: SPRING_PROFILES_ACTIVE
  47. value: "{{ .Values.paymentService.springProfiles }},{{ .Values.environment }}"
  48. - name: JAVA_OPTS
  49. value: "{{ .Values.paymentService.javaOpts }}"
  50. {{- range $key, $value := .Values.paymentService.env }}
  51. - name: {{ $key }}
  52. value: "{{ $value }}"
  53. {{- end }}
  54. {{- if .Values.paymentService.livenessProbe }}
  55. livenessProbe:
  56. {{- toYaml .Values.paymentService.livenessProbe | nindent 12 }}
  57. {{- end }}
  58. {{- if .Values.paymentService.readinessProbe }}
  59. readinessProbe:
  60. {{- toYaml .Values.paymentService.readinessProbe | nindent 12 }}
  61. {{- end }}
  62. resources:
  63. {{- toYaml .Values.paymentService.resources | nindent 12 }}
  64. volumeMounts:
  65. - name: logs
  66. mountPath: /app/logs
  67. volumes:
  68. - name: logs
  69. emptyDir: {}
  70. {{- end }}