From b0ae6e8f4e6862fcdf6d4c02d69f31035d503c14 Mon Sep 17 00:00:00 2001 From: ace Date: Mon, 18 Jul 2022 16:41:20 +0300 Subject: [PATCH] peertube: update ingress template --- peertube/Chart.yaml | 2 +- peertube/templates/ingress.yaml | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/peertube/Chart.yaml b/peertube/Chart.yaml index 8cad22a..c2e1c80 100644 --- a/peertube/Chart.yaml +++ b/peertube/Chart.yaml @@ -11,5 +11,5 @@ dependencies: repository: https://charts.bitnami.com/bitnami version: 12.3.2 type: application -version: 0.1.11 +version: 0.1.12 appVersion: 4.2.2 diff --git a/peertube/templates/ingress.yaml b/peertube/templates/ingress.yaml index 704965e..bb110d0 100644 --- a/peertube/templates/ingress.yaml +++ b/peertube/templates/ingress.yaml @@ -1,7 +1,14 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "peertube.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- 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 @@ -16,6 +23,9 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} @@ -32,10 +42,20 @@ spec: http: paths: {{- range .paths }} - - path: {{ . }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} serviceName: {{ $fullName }} servicePort: {{ $svcPort }} + {{- end }} {{- end }} {{- end }} - {{- end }} +{{- end }}