From 22ae11a0142091dc2552c6ebfc7c50618e037ae0 Mon Sep 17 00:00:00 2001 From: Thomas Deutsch Date: Mon, 5 Aug 2024 17:20:03 +0200 Subject: [PATCH] add https://github.com/hackmdio/codimd-helm/pull/21 --- charts/codimd/templates/ingress.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/charts/codimd/templates/ingress.yaml b/charts/codimd/templates/ingress.yaml index 0da448c..1ef1dca 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 }} +{{- end }} \ No newline at end of file