From a06201aaf5a531a090ec792a9119c2df14d6e50d Mon Sep 17 00:00:00 2001 From: Martin Lindner Date: Mon, 9 May 2022 13:18:13 +0900 Subject: [PATCH] feat(helm): add support for spec.ingressClassName to Ingress template (#5202) --- dev/helm/README.md | 1 + dev/helm/templates/ingress.yaml | 3 +++ dev/helm/values.yaml | 1 + 3 files changed, 5 insertions(+) diff --git a/dev/helm/README.md b/dev/helm/README.md index dc4954f1..ae95ab45 100644 --- a/dev/helm/README.md +++ b/dev/helm/README.md @@ -108,6 +108,7 @@ The following table lists the configurable parameters of the Wiki.js chart and t | `volumeMounts` | Volume mounts for Wiki.js container | `[]` | | `volumes` | Volumes for Wiki.js Pod | `[]` | | `ingress.enabled` | Enable ingress controller resource | `false` | +| `ingress.className` | Ingress class name | `""` | | `ingress.annotations` | Ingress annotations | `{}` | | `ingress.hosts` | List of ingress rules | `[{"host": "wiki.local", "paths": ["/"]}]` | | `ingress.tls` | Ingress TLS configuration | `[]` | diff --git a/dev/helm/templates/ingress.yaml b/dev/helm/templates/ingress.yaml index adf10b65..8ac1c939 100644 --- a/dev/helm/templates/ingress.yaml +++ b/dev/helm/templates/ingress.yaml @@ -23,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 }} diff --git a/dev/helm/values.yaml b/dev/helm/values.yaml index f647a583..6b7296a7 100644 --- a/dev/helm/values.yaml +++ b/dev/helm/values.yaml @@ -54,6 +54,7 @@ service: ingress: enabled: true + className: "" annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true"