deployment-gateway.yaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.image.tag | default .Chart.AppVersion }}"
  45. imagePullPolicy: {{ .Values.image.pullPolicy }}
  46. command:
  47. - sh
  48. - -c
  49. - java ${JAVA_OPTS} -jar /app/gateway.jar
  50. ports:
  51. - name: http
  52. containerPort: {{ .Values.gateway.containerPort }}
  53. protocol: {{ .Values.gateway.protocol }}
  54. env:
  55. - name: SPRING_PROFILES_ACTIVE
  56. value: "{{ .Values.gateway.springProfiles }},{{ .Values.environment }}"
  57. - name: JAVA_OPTS
  58. value: "{{ .Values.gateway.javaOpts }}"
  59. - name: SPRING_CLOUD_CONFIG_SERVER_NATIVE_SEARCH_LOCATIONS
  60. value: "file:///etc/config"
  61. {{- range $key, $value := .Values.gateway.env }}
  62. - name: {{ $key }}
  63. value: "{{ $value }}"
  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 }}