Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Adjust ingress API for Kubernetes 1.22+
Browse files Browse the repository at this point in the history
  • Loading branch information
aleveille committed Oct 7, 2021
1 parent fe356a6 commit a64d26b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ spec:
- --encryption-key={{ include "idp.encryption_key" . }}
ports:
- name: http-sso
containerPort: {{ .Values.keycloakGatekeeper.proxyPort }}
containerPort: {{ .Values.keycloakGatekeeper.port }}
protocol: TCP
{{- end }}
- name: {{ .Chart.Name }}
Expand Down
17 changes: 14 additions & 3 deletions helm/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
{{- $fullName := include "octant.fullname" . -}}
{{- $svcPort := .Values.keycloakGatekeeper.proxyPort -}}

{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if and (.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19.x" .Capabilities.KubeVersion.Version) }}
apiVersion: networking.k8s.io/v1
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
{{- else }}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
Expand Down Expand Up @@ -33,10 +35,19 @@ spec:
http:
paths:
{{- range .paths }}
- path: {{ . }}
- path: {{ .path }}
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
pathType: {{ .pathType }}
backend:
service:
name: {{ $fullName }}
port:
name: http
{{- else }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit a64d26b

Please sign in to comment.