feat: support manually managed cert issuers on k3s

The `cert-issuer-name` and `cert-issuer-kind` properties point an app's generated `Certificate` at a cert-manager issuer created outside of Dokku, allowing certificates to be issued through solvers the built-in letsencrypt integration cannot use, such as `dns01` for wildcard certificates. Setting an issuer enables https on its own, as a manually managed issuer has no email for Dokku to configure. An imported certificate still takes precedence, and `letsencrypt-server false` remains the single off switch. Dokku warns before a build starts when the referenced issuer is absent from the cluster, without blocking the deploy. Wildcard domains no longer collide with their apex domain when generating ingress names, and `letsencrypt-server` values are now validated when set rather than at deploy time.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-08-08 15:16:12 -04:00
1 parent 2da48f4f86
commit d134e75371
14 files changed
+980 -42

No files matched your search

@@ -216,3 +216,35 @@ func TestCertificateTemplateRendersPerAppNamespacedIssuer(t *testing.T) {
t.Fatalf("expected Issuer acme server %q, got %#v", LetsencryptServerStag, acme["server"])
}
}
func TestCertificateTemplateUsesManuallyManagedIssuer(t *testing.T) {
// A manually managed issuer is owned by the operator, so global.issuer is absent
// from values.yaml and Dokku must emit no Issuer of its own for either kind.
cases := []struct {
name string
kind string
}{
{name: "cluster scoped", kind: CertIssuerKindClusterIssuer},
{name: "namespaced", kind: CertIssuerKindIssuer},
}
for _, tc := range cases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
docs := renderCertificateChart(t, testCertificateValues(tc.kind, "acme-dns", nil))
issuerRef := certificateIssuerRef(t, docs)
if issuerRef["kind"] != tc.kind {
t.Fatalf("expected issuerRef.kind %s, got %#v", tc.kind, issuerRef["kind"])
}
if issuerRef["name"] != "acme-dns" {
t.Fatalf("expected issuerRef.name acme-dns, got %#v", issuerRef["name"])
}
if len(docs["issuer"]) != 0 {
t.Fatalf("expected no Issuer document for a manually managed issuer, got %#v", docs["issuer"])
}
})
}
}