From f4cf6306d2d5d22f4c066447efc341eab443c2ca Mon Sep 17 00:00:00 2001 From: Fabio Date: Wed, 19 Apr 2023 14:35:41 -0300 Subject: [PATCH] Fix Ingress in newer Kubernetes --- charts/sapl/v0.2.0/templates/ingress.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/sapl/v0.2.0/templates/ingress.yaml b/charts/sapl/v0.2.0/templates/ingress.yaml index 1519b07..2db9ab4 100644 --- a/charts/sapl/v0.2.0/templates/ingress.yaml +++ b/charts/sapl/v0.2.0/templates/ingress.yaml @@ -1,7 +1,9 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "sapl.fullname" . -}} {{- $hostName := .Values.sapl.hostname -}} -{{- 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 @@ -51,7 +53,17 @@ spec: {{- else }} - path: /* {{- end }} + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: ImplementationSpecific + {{- end }}i backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: 80 + {{- else }} serviceName: {{ $fullName }} servicePort: http + {{- end }} {{- end }}