Skip to content

Commit

Permalink
Merge pull request #2 from Maqui-LP/feature/upgrade-ingress
Browse files Browse the repository at this point in the history
Feature/upgrade ingress
  • Loading branch information
m-barthelemy authored Jun 5, 2023
2 parents cd7ab2c + 9b8d35b commit fcb973a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions charts/dex-k8s-authenticator/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
{{- $fullName := include "dex-k8s-authenticator.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- $ingressPath := .Values.ingress.path -}}
{{- 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
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
Expand All @@ -17,6 +23,9 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
Expand All @@ -33,8 +42,18 @@ spec:
http:
paths:
- path: {{ $ingressPath }}
{{- 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: {{ $servicePort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit fcb973a

Please sign in to comment.