From 0dab59d0c7b5b5293ad0d2f1f51026b94917a551 Mon Sep 17 00:00:00 2001 From: JayArrowz Date: Sat, 25 May 2024 20:36:27 +0100 Subject: [PATCH] Update _common-ingress.yaml --- .../templates/_common-ingress.yaml | 85 ++++++++++--------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/charts/common-templates/templates/_common-ingress.yaml b/charts/common-templates/templates/_common-ingress.yaml index 2269936..0b06449 100644 --- a/charts/common-templates/templates/_common-ingress.yaml +++ b/charts/common-templates/templates/_common-ingress.yaml @@ -1,49 +1,50 @@ {{- define "common.ingress" -}} {{- if .Values.ingress.enabled -}} -{{- $fullName := include "common.fullname" . -}} -{{- $svcPort := .Values.service.port -}} + {{- $fullName := include "common.fullname" . -}} + {{- $svcPort := .Values.service.port -}} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "common.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if .Values.ingress.className }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} + apiVersion: networking.k8s.io/v1 + kind: Ingress + metadata: + name: {{ $fullName }} + labels: + {{- include "common.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if .pathType }} - pathType: {{ .pathType }} - {{- else }} - pathType: Prefix - {{- end }} - backend: - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} + spec: + {{- if .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} {{- end }} + secretName: {{ .secretName }} + {{- end }} {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if .pathType }} + pathType: {{ .pathType }} + {{- else }} + pathType: Prefix + {{- end }} + backend: + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} {{- end }}