deployment-order-service.yaml 2.9 KB

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