浏览代码

feat(helm): add support for spec.ingressClassName to Ingress template (#5202)

Martin Lindner 3 年之前
父节点
当前提交
a06201aaf5
共有 3 个文件被更改,包括 5 次插入0 次删除
  1. 1 0
      dev/helm/README.md
  2. 3 0
      dev/helm/templates/ingress.yaml
  3. 1 0
      dev/helm/values.yaml

+ 1 - 0
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                   | `[]`                                                       |

+ 3 - 0
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 }}

+ 1 - 0
dev/helm/values.yaml

@@ -54,6 +54,7 @@ service:
 
 ingress:
   enabled: true
+  className: ""
   annotations: {}
     # kubernetes.io/ingress.class: nginx
     # kubernetes.io/tls-acme: "true"