From ce3e9babec1d571087b94a703234871fc91e9775 Mon Sep 17 00:00:00 2001 From: wkit23 Date: Thu, 2 Sep 2021 10:53:48 +0800 Subject: [PATCH] Add support for ingressClassName (#217) Hi, I just add some minor changes to support specifying ingressClassName to support the newer specification in `networking.k8s.io/v1`. The annotation `kubernetes.io/ingress.class: nginx` only works with older API `networking.k8s.io/v1beta1`. This is part of our move to support kubernetes 1.22. Co-authored-by: Leong Wai Kit Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/217 Reviewed-by: luhahn Reviewed-by: techknowlogick Co-authored-by: wkit23 Co-committed-by: wkit23 --- README.md | 3 ++- templates/gitea/ingress.yaml | 3 +++ values.yaml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61dd7d8..7ffe82b 100644 --- a/README.md +++ b/README.md @@ -508,7 +508,8 @@ Annotations can be added to the Gitea pod. |ingress.hosts[0].host | add hosts for ingress | git.example.com | |ingress.hosts[0].paths[0].path | add path for each ingress host | / | |ingress.hosts[0].paths[0].pathType | add ingress path type | Prefix | -|ingress.tls|add ingress tls settings|[]| +|ingress.tls| add ingress tls settings|[]| +|ingress.className| add ingress class name. Only used in k8s 1.19+ | | ### Service diff --git a/templates/gitea/ingress.yaml b/templates/gitea/ingress.yaml index e7cb645..2af0804 100644 --- a/templates/gitea/ingress.yaml +++ b/templates/gitea/ingress.yaml @@ -18,6 +18,9 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: +{{- if .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className }} +{{- end }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} diff --git a/values.yaml b/values.yaml index 554699a..99e58e2 100644 --- a/values.yaml +++ b/values.yaml @@ -57,6 +57,7 @@ service: ingress: enabled: false + # className: nginx annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true"