From 9bab8124b6448417570fd8b1e252729e1b2fd2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Falk?= Date: Wed, 4 Dec 2024 07:52:56 +0100 Subject: [PATCH 1/2] Clenup ingress template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes kubernetes checks for versions that are end-of-life since long ago Signed-off-by: André Falk --- charts/perses/templates/ingress.yaml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/charts/perses/templates/ingress.yaml b/charts/perses/templates/ingress.yaml index 7bfa7f3..1be6ee2 100644 --- a/charts/perses/templates/ingress.yaml +++ b/charts/perses/templates/ingress.yaml @@ -1,18 +1,7 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "perses.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.ingressClassName (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.ingressClassName}} - {{- 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 -{{- end }} kind: Ingress metadata: name: {{ $fullName }} @@ -23,7 +12,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- if and .Values.ingress.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + {{- if .Values.ingress.ingressClassName }} ingressClassName: {{ .Values.ingress.ingressClassName }} {{- end }} {{- if .Values.ingress.tls }} @@ -43,19 +32,12 @@ spec: paths: {{- range .paths }} - 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 }} \ No newline at end of file +{{- end }} From 6525746f162224b60596f83a2c26794766c73068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Falk?= Date: Wed, 4 Dec 2024 09:26:01 +0100 Subject: [PATCH 2/2] Fix ingress configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Falk --- charts/perses/values.schema.json | 49 ++++++++++++++++++++++---------- charts/perses/values.yaml | 11 +++---- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/charts/perses/values.schema.json b/charts/perses/values.schema.json index 694c62f..845b9cb 100644 --- a/charts/perses/values.schema.json +++ b/charts/perses/values.schema.json @@ -690,7 +690,39 @@ "hosts": { "type": "array", "items": { - "type": "string" + "type": "object", + "properties": { + "host": { + "type": "string" + }, + "paths": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "pathType": { + "type": "string", + "enum": [ + "Exact", + "Prefix", + "ImplementationSpecific" + ] + } + }, + "required": [ + "path", + "pathType" + ] + } + } + }, + "required": [ + "host", + "paths" + ] } }, "ingressClassName": { @@ -699,17 +731,6 @@ "annotations": { "type": "object" }, - "path": { - "type": "string" - }, - "pathType": { - "type": "string", - "enum": [ - "Exact", - "Prefix", - "ImplementationSpecific" - ] - }, "tls": { "type": "array", "items": { @@ -734,9 +755,7 @@ } }, "required": [ - "hosts", - "path", - "pathType" + "hosts" ] }, "serviceAccount": { diff --git a/charts/perses/values.yaml b/charts/perses/values.yaml index 97efd02..1de14de 100644 --- a/charts/perses/values.yaml +++ b/charts/perses/values.yaml @@ -191,7 +191,10 @@ ingress: # -- Default host for the ingress resource hosts: - - perses.local + - host: perses.local + paths: + - path: / + pathType: Prefix # -- IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) # This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster . @@ -204,12 +207,6 @@ ingress: # ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md annotations: {} - # -- Ingress path - path: / - - # -- Ingress path type - pathType: Prefix - # -- Ingress TLS configuration tls: [] # - secretName: ingress-cert