From 74f792c155eb0fe712b69bfca118c7aaa5992d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9lie=20Loulergue?= Date: Thu, 12 Dec 2024 15:32:43 +0100 Subject: [PATCH] variabilise ingress, with annotations & tls --- opensource/templates/nginx/nginx-ingress.yaml | 43 +++++++++++-------- opensource/values.local.yaml | 5 +++ opensource/values.yaml | 5 +++ 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/opensource/templates/nginx/nginx-ingress.yaml b/opensource/templates/nginx/nginx-ingress.yaml index a3eef6b..35ec626 100644 --- a/opensource/templates/nginx/nginx-ingress.yaml +++ b/opensource/templates/nginx/nginx-ingress.yaml @@ -3,25 +3,32 @@ kind: Ingress metadata: name: nginx-ingress annotations: - kubernetes.io/ingress.class: nginx + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: - ingressClassName: nginx + ingressClassName: {{ .Values.ingress.className }} + {{- if .Values.ingress.tls }} + tls: + - hosts: + - {{ .Values.env }}.{{ .Values.domain }} + secretName: {{ ..Release.Name }}-tls-certificate + {{- end }} rules: - - host: '{{.Values.env}}{{.Values.domain}}' + - host: '{{ .Values.env }}.{{ .Values.domain }}' http: paths: - - path: {{ if hasKey .Values.mediaProvider "apiPrefix" }}{{ .Values.mediaProvider.apiPrefix }}/assets/media{{ else }}/assets/media{{ end }} - pathType: ImplementationSpecific - backend: - service: - name: nginx - port: - number: 80 - - path: {{ if hasKey .Values.mediaProvider "apiPrefix" }}{{ .Values.mediaProvider.apiPrefix }}/catalog{{ else }}/catalog{{ end }} - pathType: ImplementationSpecific - backend: - service: - name: nginx - port: - number: 80 - + - path: {{ if hasKey .Values.mediaProvider "apiPrefix" }}{{ .Values.mediaProvider.apiPrefix }}/assets/media{{ else }}/assets/media{{ end }} + pathType: ImplementationSpecific + backend: + service: + name: nginx + port: + number: 80 + - path: {{ if hasKey .Values.mediaProvider "apiPrefix" }}{{ .Values.mediaProvider.apiPrefix }}/catalog{{ else }}/catalog{{ end }} + pathType: ImplementationSpecific + backend: + service: + name: nginx + port: + number: 80 \ No newline at end of file diff --git a/opensource/values.local.yaml b/opensource/values.local.yaml index 4183ddc..f8d85dd 100644 --- a/opensource/values.local.yaml +++ b/opensource/values.local.yaml @@ -1,5 +1,10 @@ local: true +ingress: + className: nginx + annotations: + kubernetes.io/ingress.class: nginx + redis: service: redis-service dumpFolderPath: '/dumps' diff --git a/opensource/values.yaml b/opensource/values.yaml index 400b05a..eafebe4 100644 --- a/opensource/values.yaml +++ b/opensource/values.yaml @@ -1,3 +1,8 @@ +ingress: + className: nginx + annotations: + kubernetes.io/ingress.class: nginx + redis: service: redis-service dumpFolderPath: '/dumps'