deployment-gateway.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. imagePullSecrets:
  29. - name: shop-recycle-registry-secret
  30. {{- end }}
  31. {{- if or .Values.global.registry.createSecret .Values.global.imagePullSecrets }}
  32. imagePullSecrets:
  33. {{- if .Values.global.registry.createSecret }}
  34. - name: {{ include "shop-recycle.fullname" . }}-registry-secret
  35. {{- end }}
  36. {{- with .Values.global.imagePullSecrets }}
  37. {{ toYaml . | indent 8 }}
  38. {{- end }}
  39. {{- end }}
  40. {{- with .Values.tolerations }}
  41. tolerations:
  42. {{- toYaml . | nindent 8 }}
  43. {{- end }}
  44. containers:
  45. - name: gateway
  46. image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.gateway.image.name }}:{{ .Values.gateway.image.tag }}"
  47. imagePullPolicy: {{ .Values.image.pullPolicy }}
  48. ports:
  49. - name: http
  50. containerPort: {{ .Values.gateway.containerPort }}
  51. protocol: {{ .Values.gateway.protocol }}
  52. env:
  53. - name: SPRING_PROFILES_ACTIVE
  54. value: "{{ .Values.gateway.springProfiles }},{{ .Values.environment }}"
  55. - name: JAVA_OPTS
  56. value: "{{ .Values.gateway.javaOpts }}"
  57. - name: SPRING_CLOUD_CONFIG_SERVER_NATIVE_SEARCH_LOCATIONS
  58. value: "file:///etc/config"
  59. - name: SPRING_CONFIG_LOCATION
  60. value: "file:///etc/config/application.yml"
  61. - name: SPRING_MAIN_WEB_APPLICATION_TYPE
  62. value: "reactive"
  63. {{- range $key, $value := .Values.gateway.env }}
  64. - name: {{ $key }}
  65. value: "{{ $value }}"
  66. {{- end }}
  67. {{- if .Values.gateway.startupProbe }}
  68. startupProbe:
  69. {{- toYaml .Values.gateway.startupProbe | nindent 12 }}
  70. {{- end }}
  71. {{- if .Values.gateway.livenessProbe }}
  72. livenessProbe:
  73. {{- toYaml .Values.gateway.livenessProbe | nindent 12 }}
  74. {{- end }}
  75. {{- if .Values.gateway.readinessProbe }}
  76. readinessProbe:
  77. {{- toYaml .Values.gateway.readinessProbe | nindent 12 }}
  78. {{- end }}
  79. resources:
  80. {{- toYaml .Values.gateway.resources | nindent 12 }}
  81. volumeMounts:
  82. - name: config
  83. mountPath: /etc/config
  84. - name: logs
  85. mountPath: /app/logs
  86. volumes:
  87. - name: config
  88. configMap:
  89. name: {{ include "shop-recycle.fullname" . }}-gateway-config
  90. - name: logs
  91. emptyDir: {}
  92. {{- end }}