From e2a61b962c66f94a254794645729157ff02fdb6a Mon Sep 17 00:00:00 2001 From: Fabio Date: Wed, 19 Apr 2023 15:00:01 -0300 Subject: [PATCH] Fix Ingress in portalmodelo for newer K8S versions --- .../v0.5.0/templates/ingress.yaml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/charts/portalmodelo/v0.5.0/templates/ingress.yaml b/charts/portalmodelo/v0.5.0/templates/ingress.yaml index 8d61d31..6f6cb7d 100644 --- a/charts/portalmodelo/v0.5.0/templates/ingress.yaml +++ b/charts/portalmodelo/v0.5.0/templates/ingress.yaml @@ -4,7 +4,9 @@ {{- $hostPrefix := .Values.portal.hostprefix -}} {{- $addPrefix := .Values.portal.addprefix -}} {{- $zopeFolder := .Values.portal.zopefolder -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 @@ -77,10 +79,20 @@ spec: {{- end }} {{- else }} - path: /* + {{- end }} + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: ImplementationSpecific {{- end }} backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }}-plone + port: + number: 8080 + {{- else }} serviceName: {{ $fullName }}-plone servicePort: 8080 + {{- end }} {{- if .Values.portal.addprefix }} - host: "{{ $addPrefix }}.{{ $hostName }}" http: @@ -99,9 +111,19 @@ spec: {{- end }} {{- else }} - path: /* + {{- end }} + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: ImplementationSpecific {{- end }} backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: 8080 + {{- else }} serviceName: {{ $fullName }}-plone servicePort: 8080 + {{- end }} {{- end }} {{- end }}