Files
dokku/plugins/scheduler-k3s/templates/chart/certificate.yaml
Jose Diaz-Gonzalez dc802ddd19 feat: support per-app letsencrypt emails on k3s
The `letsencrypt-email-prod` and `letsencrypt-email-stag` properties can now be set per app in addition to globally, resolving app-level before the global value for the app's selected `letsencrypt-server`. An app that sets its own email renders a namespaced cert-manager `Issuer` using that email, while apps without an override continue to use the shared `ClusterIssuer` with the global email.
2026-07-19 03:31:55 -04:00

42 lines
1.7 KiB
YAML

{{- range $processName, $config := .Values.processes }}
{{- if not (hasKey $config "web") }}
# Skip {{ $processName }} as it doesn't have a web section
{{- continue }}
{{- end }}
{{- if and $config.web.tls.enabled (not $config.web.tls.use_imported_cert) $config.web.domains }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
annotations:
dokku.com/managed: "true"
{{ include "print.annotations" (dict "config" $.Values.global "key" "certificate") | indent 4 }}
{{ include "print.annotations" (dict "config" $config "key" "certificate") | indent 4 }}
labels:
app.kubernetes.io/name: {{ $.Values.global.app_name }}-{{ $processName }}
app.kubernetes.io/part-of: {{ $.Values.global.app_name }}
{{ include "print.labels" (dict "config" $.Values.global "key" "certificate") | indent 4 }}
{{ include "print.labels" (dict "config" $config "key" "certificate") | indent 4 }}
name: {{ $.Values.global.app_name }}-{{ $processName }}
namespace: {{ $.Values.global.namespace }}
spec:
issuerRef:
kind: {{ $config.web.tls.issuer_kind | default "ClusterIssuer" }}
name: {{ $config.web.tls.issuer_name }}
secretName: tls-{{ $.Values.global.app_name }}-{{ $processName }}
secretTemplate:
annotations:
dokku.com/managed: "true"
labels:
app.kubernetes.io/name: {{ $.Values.global.app_name }}-{{ $processName }}
app.kubernetes.io/part-of: {{ $.Values.global.app_name }}
{{ include "print.labels" (dict "config" $.Values.global "key" "secret") | indent 6 }}
{{ include "print.labels" (dict "config" $config "key" "secret") | indent 6 }}
dnsNames:
{{- range $idx, $domain := $config.web.domains }}
- {{ $domain.name }}
{{- end }}
{{- end }}
{{- end }}