2 Commits

2 changed files with 61 additions and 22 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:
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

@@ -12,7 +12,7 @@
#hyperkittyApiKey: supersecret
#djangoSecretKey: supersecret
hostname: lists.example.org
hostname: lists.example.com
imagePullSecrets: []
nameOverride: ""
@@ -70,9 +70,14 @@ 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"
className: ""
pathType: Prefix
annotations: {}
hosts:
- host: lists.example.com
paths:
- path: /
tls: []
# - secretName: chart-example-tls
# hosts:
# - git.example.com