cert-manager

Wildcard TLS certificate for *.madhan.app via Let's Encrypt DNS-01 challenge and Cloudflare.

What is cert-manager?

cert-manager is a Kubernetes controller that automates the issuance and renewal of TLS certificates from ACME providers like Let's Encrypt. It supports DNS-01 challenges, which allow issuing wildcard certificates without requiring public HTTP access.

Why cert-manager?

DNS-01 challenge via Cloudflare lets cert-manager obtain a wildcard *.madhan.app certificate for a private cluster that has no public HTTP endpoint — the only requirement is write access to the Cloudflare DNS zone.

How It's Used Here

cert-manager issues and renews a single wildcard certificate (wildcard-madhan-app-tls) stored in kube-system, which the shared Cilium Gateway uses for HTTPS termination across all services. Managed by Pulumi (core/platform/cert_manager.go, stack: platform):

just core platform up

Chart

SettingValue
Chartcert-manager
Repohttps://charts.jetstack.io
Versionv1.19.3
Namespacecert-manager
CRDsBundled (installCRDs: true)

ClusterIssuers

NameTypeUsed For
letsencrypt-prodACME DNS-01 via CloudflareWildcard *.madhan.app certificate
homelab-caSelf-signedInternal / testing certificates

Wildcard Certificate

SettingValue
Namewildcard-madhan-app
Namespacekube-system
Secretwildcard-madhan-app-tls
DNS namesmadhan.app, *.madhan.app
Issuerletsencrypt-prod

The certificate lives in kube-system so the homelab-gateway HTTPS listener can reference it across namespaces.

Cloudflare API Token

The DNS-01 solver requires a Cloudflare API token scoped to madhan.app:

PermissionPurpose
Zone → Zone → ReadResolve domain to Cloudflare Zone ID
Zone → DNS → EditCreate/delete _acme-challenge TXT records

The token is stored in the cert-manager/cloudflare-api-token Secret (key: CLOUDFLARE_API_TOKEN), created by just create-secrets from SOPS. It carries argocd.argoproj.io/sync-options: Prune=false so ArgoCD never deletes it.

Bootstrap Dependency

cert-manager needs the cloudflare-api-token Secret before it can issue certificates:

just create-secrets   # creates the Secret from SOPS
just core platform up # deploys cert-manager + ClusterIssuer

Current Status

The HTTPS Gateway listener is currently disabled pending wildcard-madhan-app-tls creation. All app URLs use HTTP.

Once the certificate exists in kube-system, re-enable the HTTPS listener in core/platform/cilium.go and run just core platform up.

Troubleshooting

# Watch Certificate status
kubectl describe certificate wildcard-madhan-app -n kube-system

# Watch CertificateRequest and Order objects
kubectl get certificaterequests,orders -n kube-system

# Check cert-manager logs for Cloudflare API errors
kubectl logs -n cert-manager deployment/cert-manager | grep -i cloudflare

A successful issuance shows: Status: True Type: Ready Message: Certificate is up to date and has not expired