Skip to content

Commit

Permalink
Update ingress apiVersion (hashicorp#310)
Browse files Browse the repository at this point in the history
The apiVersion `extensions/v1beta1` for ingresses has been removed in Kubernetes 1.16 and the new `networking.k8s.io/v1beta1` has to be used now. This conditional keeps compatibility with older Kubernetes versions while using the new apiVersion when available.
  • Loading branch information
gmaiztegi authored May 27, 2020
1 parent 9a835c4 commit 6b77840
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/server-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
{{- if .Values.server.ingress.enabled -}}
{{- $serviceName := include "vault.fullname" . -}}
{{- $servicePort := .Values.server.service.port -}}
{{ if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
apiVersion: networking.k8s.io/v1beta1
{{ else }}
apiVersion: extensions/v1beta1
{{ end }}
kind: Ingress
metadata:
name: {{ template "vault.fullname" . }}
Expand Down

0 comments on commit 6b77840

Please sign in to comment.