Skip to content

Commit

Permalink
ingress: change flag for using old annotation to 'useOldClassAnnotation'
Browse files Browse the repository at this point in the history
ensure 'kubernetes.io/ingress.class' and 'ingressClassName' are mutually exclusive, defaulting to latter
unless 'useOldClassAnnotation' is set
  • Loading branch information
ikreymer committed Jan 16, 2025
1 parent 0b27119 commit 6f20a9f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
13 changes: 12 additions & 1 deletion chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
name: ingress-main
namespace: {{ .Release.Namespace }}
annotations:
{{- if .Values.ingress.useOldClassAnnotation }}
kubernetes.io/ingress.class: {{ .Values.ingress_class | default "nginx" }}
{{- end }}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
Expand All @@ -21,7 +24,9 @@ metadata:
proxy_set_header X-Forwarded-Proto {{ .Values.ingress.tls | ternary "https" "http" }};
spec:
{{- if not .Values.ingress.useOldClassAnnotation }}
ingressClassName: {{ .Values.ingress_class | default "nginx" }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
- hosts:
Expand Down Expand Up @@ -58,11 +63,16 @@ metadata:
name: ingress-authsign
namespace: {{ .Release.Namespace }}
annotations:
{{- if .Values.ingress.useOldClassAnnotation }}
kubernetes.io/ingress.class: {{ .Values.ingress_class | default "nginx" }}
{{- end }}
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/upstream-vhost: "{{ .Values.signer.host }}"

spec:
{{- if not .Values.ingress.useOldClassAnnotation }}
ingressClassName: {{ .Values.ingress_class | default "nginx" }}
{{- end }}
rules:
- host: {{ .Values.signer.host }}
http:
Expand Down Expand Up @@ -101,8 +111,9 @@ spec:
solvers:
- http01:
ingress:
{{- if not .Values.ingress.useOldClassAnnotation }}
ingressClassName: {{ .Values.ingress_class | default "nginx" }}
{{- if .Values.ingress.useOldClassField }}
{{- else }}
class: {{ .Values.ingress_class | default "nginx" }}
{{- end }}

Expand Down
10 changes: 5 additions & 5 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,11 @@ ingress:
cert_email: "[email protected]"
tls: false

# This is related to the issues webrecorder/browsertrix#1570 and cert-manager/cert-manager#6184
# This relates to the new `http01.ingress.ingressClassName` solver spec attribute which got introduced in the recent v1.15 cert-manager version.
# Cert-manager v1.15 does not want the fields ingressClassName and class be set at the same time.
useOldClassField: false
# If set, will use the old 'kubernetes.io/ingress.class' annotation instead of the new ingressClassName
# also uses old http01.ingress.class in cert-manager instead of http01.ingress.ingressClassName
# provided for backwards compatibility
useOldClassAnnotation: false

# Optional: Uncomment to use your own cluster-issuer instead of default ACME https validation
# custom_cluster_issuer: custom_cluster_issuer-name

Expand Down

0 comments on commit 6f20a9f

Please sign in to comment.