diff --git a/kibana/templates/_helpers.tpl b/kibana/templates/_helpers.tpl index 6e984449c..a5254f445 100755 --- a/kibana/templates/_helpers.tpl +++ b/kibana/templates/_helpers.tpl @@ -14,3 +14,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- $name := default .Release.Name .Values.nameOverride -}} {{- printf "%s-%s" $name .Chart.Name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the appropriate apiVersion for ingress. +*/}} +{{- define "kibana.ingress.apiVersion" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "extensions/v1beta1" -}} +{{- else -}} +{{- print "networking.k8s.io/v1beta1" -}} +{{- end -}} +{{- end -}} diff --git a/kibana/templates/ingress.yaml b/kibana/templates/ingress.yaml index cd4914930..690b0c73b 100644 --- a/kibana/templates/ingress.yaml +++ b/kibana/templates/ingress.yaml @@ -2,7 +2,7 @@ {{- $fullName := include "fullname" . -}} {{- $servicePort := .Values.service.port -}} {{- $ingressPath := .Values.ingress.path -}} -apiVersion: extensions/v1beta1 +apiVersion: {{ template "kibana.ingress.apiVersion" . }} kind: Ingress metadata: name: {{ $fullName }}