Copied ingress template from Gitea helm chart

This commit is contained in:
2026-03-31 19:06:56 -04:00
parent 31908f6439
commit 80014450fa
2 changed files with 52 additions and 21 deletions

View File

@@ -1,29 +1,63 @@
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $fullName := include "mailman3.fullname" . -}} {{- $fullName := include "mailman3.fullname" . -}}
{{- $svcPort := .Values.service.port -}} {{- $httpPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ $fullName }} name: {{ $fullName }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels: labels:
{{- include "mailman3.labels" . | nindent 4 }} {{- include "mailman3.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }} {{- end }}
spec: spec:
ingressClassName: {{ tpl .Values.ingress.className . }}
{{- if .Values.ingress.tls }} {{- if .Values.ingress.tls }}
tls: tls:
{{- range .Values.ingress.tls }}
- hosts: - hosts:
- {{ .Values.hostname }} {{- range .hosts }}
secretName: {{ include "mailman3.fullname" . }}-certificate - {{ tpl . $ | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }} {{- end }}
rules: rules:
- host: {{ .Values.hostname | quote }} {{- range .Values.ingress.hosts }}
- host: {{ tpl .host $ | quote }}
http: http:
paths: paths:
- path: / {{- if .paths }}
{{- range .paths }}
{{- if kindIs "string" . }}
- path: {{ . }}
pathType: {{ default "Prefix" $.Values.ingress.pathType }}
backend: backend:
serviceName: {{ include "mailman3.fullname" . }}-web service:
servicePort: 80 name: {{ $fullName }}-http
port:
number: {{ $httpPort }}
{{- else }}
- path: {{ .path | default "/" }}
pathType: {{ .pathType | default "Prefix" }}
backend:
service:
name: {{ $fullName }}-http
port:
number: {{ $httpPort }}
{{- end }} {{- 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: ingress:
enabled: false enabled: false
tls: false tls: []
annotations: className: letsencrypt-prod
# use NGINX Ingress Controller annotations: {}
#kubernetes.io/ingress.class: "nginx"
# use Cert-Manager for LetsEncrypt Certificates
#cert-manager.io/issuer: "letsencrypt-prod"