deployment-gateway.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {{- if .Values.gateway.enabled }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ include "shop-recycle.fullname" . }}-gateway
  6. labels:
  7. app: {{ include "shop-recycle.fullname" . }}-gateway
  8. {{- include "shop-recycle.labels" . | nindent 4 }}
  9. namespace: {{ .Release.Namespace }}
  10. spec:
  11. replicas: {{ .Values.gateway.replicaCount }}
  12. selector:
  13. matchLabels:
  14. app: {{ include "shop-recycle.fullname" . }}-gateway
  15. {{- include "shop-recycle.selectorLabels" . | nindent 6 }}
  16. template:
  17. metadata:
  18. annotations:
  19. prometheus.io/scrape: "true"
  20. prometheus.io/port: "{{ .Values.gateway.containerPort }}"
  21. prometheus.io/path: "/actuator/prometheus"
  22. labels:
  23. app: {{ include "shop-recycle.fullname" . }}-gateway
  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: gateway
  44. image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.gateway.image.name }}:{{ .Values.gateway.image.tag }}"
  45. imagePullPolicy: {{ .Values.image.pullPolicy }}
  46. ports:
  47. - name: http
  48. containerPort: {{ .Values.gateway.containerPort }}
  49. protocol: {{ .Values.gateway.protocol }}
  50. env:
  51. - name: SPRING_PROFILES_ACTIVE
  52. value: "{{ .Values.gateway.springProfiles }},{{ .Values.environment }}"
  53. - name: JAVA_OPTS
  54. value: "{{ .Values.gateway.javaOpts }}"
  55. - name: SPRING_CLOUD_CONFIG_SERVER_NATIVE_SEARCH_LOCATIONS
  56. value: "file:///etc/config"
  57. {{- range $key, $value := .Values.gateway.env }}
  58. - name: {{ $key }}
  59. value: "{{ $value }}"
  60. {{- end }}
  61. {{- if .Values.gateway.startupProbe }}
  62. startupProbe:
  63. {{- toYaml .Values.gateway.startupProbe | nindent 12 }}
  64. {{- end }}
  65. {{- if .Values.gateway.livenessProbe }}
  66. livenessProbe:
  67. {{- toYaml .Values.gateway.livenessProbe | nindent 12 }}
  68. {{- end }}
  69. {{- if .Values.gateway.readinessProbe }}
  70. readinessProbe:
  71. {{- toYaml .Values.gateway.readinessProbe | nindent 12 }}
  72. {{- end }}
  73. resources:
  74. {{- toYaml .Values.gateway.resources | nindent 12 }}
  75. volumeMounts:
  76. - name: config
  77. mountPath: /etc/config
  78. - name: logs
  79. mountPath: /app/logs
  80. volumes:
  81. - name: config
  82. configMap:
  83. name: {{ include "shop-recycle.fullname" . }}-gateway-config
  84. - name: logs
  85. emptyDir: {}
  86. {{- end }}