deployment-gateway.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. {{- with .Values.affinity }}
  30. affinity:
  31. {{- toYaml . | nindent 8 }}
  32. {{- end }}
  33. {{- with .Values.tolerations }}
  34. tolerations:
  35. {{- toYaml . | nindent 8 }}
  36. {{- end }}
  37. containers:
  38. - name: gateway
  39. image: "{{ .Values.image.registry }}/{{ .Values.image.namespace }}/{{ .Values.gateway.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  40. imagePullPolicy: {{ .Values.image.pullPolicy }}
  41. ports:
  42. - name: http
  43. containerPort: {{ .Values.gateway.containerPort }}
  44. protocol: {{ .Values.gateway.protocol }}
  45. env:
  46. - name: SPRING_PROFILES_ACTIVE
  47. value: "{{ .Values.gateway.springProfiles }},{{ .Values.environment }}"
  48. - name: JAVA_OPTS
  49. value: "{{ .Values.gateway.javaOpts }}"
  50. - name: SPRING_CLOUD_CONFIG_SERVER_NATIVE_SEARCH_LOCATIONS
  51. value: "file:///etc/config"
  52. {{- range $key, $value := .Values.gateway.env }}
  53. - name: {{ $key }}
  54. value: "{{ $value }}"
  55. {{- end }}
  56. {{- if .Values.gateway.livenessProbe }}
  57. livenessProbe:
  58. {{- toYaml .Values.gateway.livenessProbe | nindent 12 }}
  59. {{- end }}
  60. {{- if .Values.gateway.readinessProbe }}
  61. readinessProbe:
  62. {{- toYaml .Values.gateway.readinessProbe | nindent 12 }}
  63. {{- end }}
  64. resources:
  65. {{- toYaml .Values.gateway.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" . }}-gateway-config
  75. - name: logs
  76. emptyDir: {}
  77. {{- end }}