deployment-payment-service.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. {{- if or .Values.global.registry.createSecret .Values.global.imagePullSecrets }}
  30. imagePullSecrets:
  31. {{- if .Values.global.registry.createSecret }}
  32. - name: {{ include "shop-recycle.fullname" . }}-registry-secret
  33. {{- end }}
  34. {{- with .Values.global.imagePullSecrets }}
  35. {{ toYaml . | indent 8 }}
  36. {{- end }}
  37. {{- end }}
  38. {{- with .Values.tolerations }}
  39. tolerations:
  40. {{- toYaml . | nindent 8 }}
  41. {{- end }}
  42. containers:
  43. - name: payment-service
  44. image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.paymentService.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  45. imagePullPolicy: {{ .Values.image.pullPolicy }}
  46. command:
  47. - sh
  48. - -c
  49. - java ${JAVA_OPTS} -jar /app/payment-service.jar
  50. ports:
  51. - name: http
  52. containerPort: {{ .Values.paymentService.containerPort }}
  53. protocol: {{ .Values.paymentService.protocol }}
  54. env:
  55. - name: SPRING_PROFILES_ACTIVE
  56. value: "{{ .Values.paymentService.springProfiles }},{{ .Values.environment }}"
  57. - name: JAVA_OPTS
  58. value: "{{ .Values.paymentService.javaOpts }}"
  59. {{- range $key, $value := .Values.paymentService.env }}
  60. - name: {{ $key }}
  61. value: "{{ $value }}"
  62. {{- end }}
  63. {{- if .Values.paymentService.livenessProbe }}
  64. livenessProbe:
  65. {{- toYaml .Values.paymentService.livenessProbe | nindent 12 }}
  66. {{- end }}
  67. {{- if .Values.paymentService.readinessProbe }}
  68. readinessProbe:
  69. {{- toYaml .Values.paymentService.readinessProbe | nindent 12 }}
  70. {{- end }}
  71. resources:
  72. {{- toYaml .Values.paymentService.resources | nindent 12 }}
  73. volumeMounts:
  74. - name: logs
  75. mountPath: /app/logs
  76. volumes:
  77. - name: logs
  78. emptyDir: {}
  79. {{- end }}