deployment-order-service.yaml 3.0 KB

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