From 25db693530b28ac95e5d36f7a99a1d4b2ae5ebcb Mon Sep 17 00:00:00 2001 From: Thomas Deutsch Date: Mon, 29 Nov 2021 10:04:57 +0100 Subject: [PATCH 1/2] Add compatibility with Kubernetes 1.22+ `networking.k8s.io/v1beta1` is deprecated since 1.19 and removed since 1.22. It's replace with `networking.k8s.io/v1` --- charts/codimd/templates/ingress.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/codimd/templates/ingress.yaml b/charts/codimd/templates/ingress.yaml index 0da448c..0a6881f 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 From 0c77dc29e5fd8142f4c603c4c4e8e738d6b6c3e1 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Wed, 23 Mar 2022 14:15:58 +0800 Subject: [PATCH 2/2] ingress: fix fields for networking.k8s.io/v1 --- charts/codimd/templates/ingress.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/codimd/templates/ingress.yaml b/charts/codimd/templates/ingress.yaml index 0a6881f..33eceb0 100644 --- a/charts/codimd/templates/ingress.yaml +++ b/charts/codimd/templates/ingress.yaml @@ -36,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 }}