Skip to content

Commit

Permalink
ingress: only set ssl-redirect if using tls (#2432)
Browse files Browse the repository at this point in the history
otherwise, http path should be accessible. Can be used when TLS
termination handled outside of ingress.
  • Loading branch information
ikreymer authored Feb 27, 2025
1 parent 00e85c3 commit 6766843
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ metadata:
{{- 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"
# for larger uploads to not timeout
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
nginx.ingress.kubernetes.io/proxy-buffering: "off"
nginx.ingress.kubernetes.io/upstream-vhost: "{{ .Values.ingress.host }}"
{{- if .Values.ingress.tls }}
cert-manager.io/cluster-issuer: {{ .Values.ingress.custom_cluster_issuer | default "cert-main" }}
{{- end }}
nginx.ingress.kubernetes.io/upstream-vhost: "{{ .Values.ingress.host }}"
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header X-Forwarded-Proto {{ .Values.ingress.tls | ternary "https" "http" }};
nginx.ingress.kubernetes.io/ssl-redirect: "true"
{{- else }}
nginx.ingress.kubernetes.io/ssl-redirect: "false"
{{- end }}

spec:
{{- if not .Values.ingress.useOldClassAnnotation }}
Expand Down

0 comments on commit 6766843

Please sign in to comment.