diff --git a/charts/codimd/templates/ingress.yaml b/charts/codimd/templates/ingress.yaml index 0da448c..33eceb0 100644 --- a/charts/codimd/templates/ingress.yaml +++ b/charts/codimd/templates/ingress.yaml @@ -1,7 +1,9 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "codimd.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- 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 @@ -34,8 +36,16 @@ spec: {{- range .paths }} - path: {{ . }} backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + pathType: Prefix + {{- else }} serviceName: {{ $fullName }} servicePort: {{ $svcPort }} + {{- end }} {{- end }} {{- end }} {{- end }}