1 Commits

Author SHA1 Message Date
80014450fa Copied ingress template from Gitea helm chart 2026-03-31 19:06:56 -04:00
2 changed files with 52 additions and 21 deletions

View File

@@ -1,29 +1,63 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "mailman3.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- $httpPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "mailman3.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
ingressClassName: {{ tpl .Values.ingress.className . }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.hostname }}
secretName: {{ include "mailman3.fullname" . }}-certificate
{{- range .hosts }}
- {{ tpl . $ | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.hostname | quote }}
{{- range .Values.ingress.hosts }}
- host: {{ tpl .host $ | quote }}
http:
paths:
- path: /
{{- if .paths }}
{{- range .paths }}
{{- if kindIs "string" . }}
- path: {{ . }}
pathType: {{ default "Prefix" $.Values.ingress.pathType }}
backend:
serviceName: {{ include "mailman3.fullname" . }}-web
servicePort: 80
service:
name: {{ $fullName }}-http
port:
number: {{ $httpPort }}
{{- else }}
- path: {{ .path | default "/" }}
pathType: {{ .pathType | default "Prefix" }}
backend:
service:
name: {{ $fullName }}-http
port:
number: {{ $httpPort }}
{{- end }}
{{- end }}
{{- else }}
- path: "/"
pathType: "Prefix"
backend:
service:
name: {{ $fullName }}-http
port:
number: {{ $httpPort }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -70,9 +70,6 @@ service:
ingress:
enabled: false
tls: false
annotations:
# use NGINX Ingress Controller
#kubernetes.io/ingress.class: "nginx"
# use Cert-Manager for LetsEncrypt Certificates
#cert-manager.io/issuer: "letsencrypt-prod"
tls: []
className: letsencrypt-prod
annotations: {}