Cert Manager¶
cert-manager issues and renews the TLS certificates behind every *.prod.skatzi.com hostname, requesting them from Let's Encrypt and solving the HTTP-01 challenge through the shared Gateway API gateway.
Overview¶
Dependencies¶
| Dependency | Why |
|---|---|
Cilium (cilium-config Kustomization) |
config.enableGatewayAPI: true requires the Gateway API CRDs and controller that Cilium provides |
Gateway API shared-gateway (gateway-system component, namespace gateway-system) |
The ClusterIssuers solve ACME HTTP-01 challenges via gatewayHTTPRoute, routed through this Gateway |
Exposed Services¶
cert-manager has no externally routed service of its own — it issues Certificate resources consumed by other components' HTTPRoute/Gateway TLS configuration.
| ClusterIssuer | ACME server | Use |
|---|---|---|
letsencrypt-staging |
acme-staging-v02.api.letsencrypt.org |
Testing certificate issuance without hitting Let's Encrypt's production rate limits |
letsencrypt-prod |
acme-v02.api.letsencrypt.org |
Real, browser-trusted certificates |
Repository Layout¶
components/cert-manager/
├── base/
│ ├── namespace.yaml # cert-manager namespace
│ ├── helmrepository.yaml # Jetstack chart repo
│ ├── helmrelease.yaml # cert-manager controller, webhook, cainjector
│ └── kustomization.yaml
└── config/
├── clusterissuers.yaml # letsencrypt-staging and letsencrypt-prod ClusterIssuers
└── kustomization.yaml
This is a two-phase component: base installs the controller via Helm (with CRDs managed in-release, crds.enabled: true), and config applies the ClusterIssuers afterwards. The two phases exist as separate Flux Kustomizations — cert-manager and cert-manager-config — so that config only reconciles once the controller's webhook is actually serving (a ClusterIssuer applied before the webhook is ready fails admission).
Cluster wiring¶
Both clusters wire these up identically in cluster/<name>/cert-manager/kustomization.yaml:
---
# installs the controller
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cert-manager
spec:
path: ./components/cert-manager/base
healthChecks:
- apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
name: cert-manager
namespace: cert-manager
---
# applies ClusterIssuers once the controller is healthy
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cert-manager-config
spec:
path: ./components/cert-manager/config
dependsOn:
- name: cert-manager
healthChecks:
- apiVersion: cert-manager.io/v1
kind: ClusterIssuer
name: letsencrypt-staging
- apiVersion: cert-manager.io/v1
kind: ClusterIssuer
name: letsencrypt-prod
hetzner-mgmt additionally declares dependsOn: [cilium-config] on the cert-manager Kustomization itself, since it needs the Gateway API CRDs that Cilium's config brings in.
Neither ClusterIssuer nor the HelmRelease values differ between clusters today — there is no cluster-level patch for this component.
Safe Change Workflow¶
- Chart version bumps: edit
chart.spec.versionincomponents/cert-manager/base/helmrelease.yaml. Check the cert-manager upgrade notes for the target version — major version jumps can require re-applying CRDs or deprecate API versions used byClusterIssuer/Certificateresources elsewhere in the repo. - Issuer changes (new solver, new ACME account, adding a new issuer): edit
components/cert-manager/config/clusterissuers.yaml. Prefer testing againstletsencrypt-stagingfirst — Let's Encrypt's production ACME server has strict rate limits, and a misconfigured solver applied cluster-wide can lock out certificate issuance for a while. - Because
ClusterIssuers are cluster-scoped and shared by everyCertificatein the cluster, treat them as high blast-radius: a brokenletsencrypt-prodissuer blocks renewal for every hostname, not just the one you're testing. - Both
cert-managerandcert-manager-configdeclarehealthChecks, so Flux won't report the KustomizationReadyuntil the HelmRelease and bothClusterIssuers are actually healthy — watchflux --context <context> get kustomizations cert-manager cert-manager-configafter merging, on each cluster, with its kubeconfig context in place of<context>(rules of engagement, rule 8). - If a value genuinely needs to differ per cluster in future (e.g. a different ACME email or a cluster-specific solver), add a
patchesblock incluster/<name>/cert-manager/kustomization.yamlrather than forking the component, per the repository structure conventions.