deployment-payment-service.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. imagePullSecrets:
  29. - name: shop-recycle-registry-secret
  30. imagePullSecrets:
  31. - name: shop-recycle-registry-secret
  32. {{- end }}
  33. containers:
  34. - name: payment-service
  35. image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.paymentService.image.name }}:{{ .Values.paymentService.image.tag }}"
  36. imagePullPolicy: {{ .Values.image.pullPolicy }}
  37. ports:
  38. - name: http
  39. containerPort: {{ .Values.paymentService.containerPort }}
  40. protocol: {{ .Values.paymentService.protocol }}
  41. env:
  42. - name: SPRING_PROFILES_ACTIVE
  43. value: "{{ .Values.paymentService.springProfiles }},{{ .Values.environment }}"
  44. - name: JAVA_OPTS
  45. value: "{{ .Values.paymentService.javaOpts }}"
  46. - name: SPRING_CONFIG_LOCATION
  47. value: "file:///etc/config/application.yml"
  48. - name: SPRING_MAIN_WEB_APPLICATION_TYPE
  49. value: "servlet"
  50. - name: LOGGING_LEVEL_ROOT
  51. value: "INFO"
  52. - name: SPRING_CLOUD_CONFIG_ENABLED
  53. value: "true"
  54. {{- if .Values.paymentService.startupProbe }}
  55. startupProbe:
  56. {{- toYaml .Values.paymentService.startupProbe | nindent 12 }}
  57. {{- end }}
  58. {{- if .Values.paymentService.livenessProbe }}
  59. livenessProbe:
  60. {{- toYaml .Values.paymentService.livenessProbe | nindent 12 }}
  61. {{- end }}
  62. {{- if .Values.paymentService.readinessProbe }}
  63. readinessProbe:
  64. {{- toYaml .Values.paymentService.readinessProbe | nindent 12 }}
  65. {{- end }}
  66. resources:
  67. {{- toYaml .Values.paymentService.resources | nindent 12 }}
  68. volumeMounts:
  69. - name: config
  70. mountPath: /etc/config
  71. - name: logs
  72. mountPath: /app/logs
  73. volumes:
  74. - name: config
  75. configMap:
  76. name: {{ include "shop-recycle.fullname" . }}-payment-service-config
  77. - name: logs
  78. emptyDir: {}
  79. {{- end }}