certmanager-letsencrypt

by somaz94

Helm chartv0.2.4App 1.0.0Apache-2.0Verified publisher

Helm chart for Let's Encrypt certificates with cert-manager — manages ClusterIssuers / Issuers / Certificates / DNS-01 credential Secrets in one place. Requires cert-manager already installed.

About this chart

certmanager-letsencrypt

A Helm chart that manages cert-manager Let's Encrypt resources — ClusterIssuer / Issuer / Certificate / DNS-01 credential Secret — in one place. Requires cert-manager already installed.

The upstream cert-manager chart installs the operator and CRDs, but does not create the tenant-level resources you actually issue certificates with. This chart fills that gap with a multi-issuer / multi-certificate / multi-secret schema.

What it deploys

ResourceAPIPurpose
Secretv1Optional. Multiple credential secrets (DNS provider API tokens, service accounts, etc.)
ClusterIssuercert-manager.io/v1Cluster-scoped ACME issuers (most common — one prod, one staging)
Issuercert-manager.io/v1Namespace-scoped issuers (use for tenant isolation)
Certificatecert-manager.io/v1Per-domain certificate requests (cert-manager creates the actual TLS Secret)

Prerequisites

  • Kubernetes 1.25+
  • cert-manager installed (provides cert-manager.io CRDs)
  • DNS provider account with API access (Cloudflare, Route53, Cloud DNS, ...) — DNS-01 challenge
  • A registered domain whose DNS you control

Install

OCI registry (Helm 3.8+)

helm install cert oci://ghcr.io/somaz94/charts/certmanager-letsencrypt \
  --version 0.2.0 \
  --namespace cert-manager \
  -f my-values.yaml

Classic Helm repo

helm repo add somaz94 https://charts.somaz.blog
helm repo update
helm install cert somaz94/certmanager-letsencrypt \
  --namespace cert-manager \
  -f my-values.yaml

Quick examples

Each per-provider example below is a complete, end-to-end install: credential Secret → ClusterIssuer (prod + staging) → Certificate → Ingress (with the cert-manager annotation pre-wired). Drop into a single values file and helm install.

Use the staging issuer (letsencrypt-staging) while iterating to avoid Let's Encrypt rate limits, then switch issuerRef.name to letsencrypt-prod once everything works.

Cloudflare DNS-01

secrets:
  - name: cloudflare-api-token
    namespace: cert-manager
    type: Opaque
    stringData:
      api-token: "<your-cloudflare-api-token>"

clusterIssuers:
  - name: letsencrypt-prod
    email: [email protected]
    server: https://acme-v02.api.letsencrypt.org/directory
    solvers:
      - dns01:
          cloudflare:
            apiTokenSecretRef:
              name: cloudflare-api-token
              key: api-token

  - name: letsencrypt-staging
    email: [email protected]
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    solvers:
      - dns01:
          cloudflare:
            apiTokenSecretRef:
              name: cloudflare-api-token
              key: api-token

certificates:
  - name: example-com-tls
    namespace: default
    secretName: example-com-tls
    issuerRef:
      name: letsencrypt-prod
      kind: ClusterIssuer
    commonName: example.com
    dnsNames:
      - example.com
      - "*.example.com"

ingresses:
  - name: example-com-ingress
    namespace: default
    ingressClassName: nginx
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt-prod
      nginx.ingress.kubernetes.io/rewrite-target: /
    rules:
      - host: example.com
        http:
          paths:
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: my-app
                  port:
                    name: http
    tls:
      - hosts:
          - example.com
        secretName: example-com-tls

AWS Route53 DNS-01

secrets:
  - name: route53-credentials
    namespace: cert-manager
    type: Opaque
    stringData:
      secret-access-key: "<aws-secret-access-key>"

clusterIssuers:
  - name: letsencrypt-prod
    email: [email protected]
    server: https://acme-v02.api.letsencrypt.org/directory
    solvers:
      - dns01:
          route53:
            region: us-east-1
            accessKeyID: "<aws-access-key>"
            secretAccessKeySecretRef:
              name: route53-credentials
              key: secret-access-key

  - name: letsencrypt-staging
    email: [email protected]
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    solvers:
      - dns01:
          route53:
            region: us-east-1
            accessKeyID: "<aws-access-key>"
            secretAccessKeySecretRef:
              name: route53-credentials
              key: secret-access-key

certificates:
  - name: example-com-tls
    namespace: default
    secretName: example-com-tls
    issuerRef:
      name: letsencrypt-prod
      kind: ClusterIssuer
    dnsNames:
      - example.com

ingresses:
  - name: example-com-ingress
    namespace: default
    ingressClassName: nginx
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt-prod
      nginx.ingress.kubernetes.io/rewrite-target: /
    rules:
      - host: example.com
        http:
          paths:
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: my-app
                  port:
                    name: http
    tls:
      - hosts:
          - example.com
        secretName: example-com-tls

For IRSA / IAM Roles for Service Accounts: omit accessKeyID and secretAccessKeySecretRef, use cert-manager's serviceAccount ServiceAccount referenced via eks.amazonaws.com/role-arn annotation. See cert-manager Route53 docs.

Google Cloud DNS DNS-01

secrets:
  - name: clouddns-credentials
    namespace: cert-manager
    type: Opaque
    data:
      key.json: "<base64-encoded-service-account-json>"

clusterIssuers:
  - name: letsencrypt-prod
    email: [email protected]
    server: https://acme-v02.api.letsencrypt.org/directory
    solvers:
      - dns01:
          cloudDNS:
            project: "<gcp-project-id>"
            serviceAccountSecretRef:
              name: clouddns-credentials
              key: key.json

  - name: letsencrypt-staging
    email: [email protected]
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    solvers:
      - dns01:
          cloudDNS:
            project: "<gcp-project-id>"
            serviceAccountSecretRef:
              name: clouddns-credentials
              key: key.json

certificates:
  - name: example-com-tls
    namespace: default
    secretName: example-com-tls
    issuerRef:
      name: letsencrypt-prod
      kind: ClusterIssuer
    dnsNames:
      - example.com

ingresses:
  - name: example-com-ingress
    namespace: default
    ingressClassName: nginx
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt-prod
      nginx.ingress.kubernetes.io/rewrite-target: /
    rules:
      - host: example.com
        http:
          paths:
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: my-app
                  port:
                    name: http
    tls:
      - hosts:
          - example.com
        secretName: example-com-tls

For Workload Identity (recommended on GKE): omit the JSON Secret, use serviceAccountSecretRef-less form with cert-manager pod's iam.gke.io/gcp-service-account annotation. See cert-manager Cloud DNS docs.

Values reference

Top-level

KeyTypeDefaultDescription
commonLabelsobject{}Labels added to every resource.
commonAnnotationsobject{}Annotations added to every resource.
acmeServers.letsencryptProdstringLE prod URLProduction ACME endpoint (helper constant).
acmeServers.letsencryptStagingstringLE staging URLStaging ACME endpoint (helper constant).

secrets[]

KeyTypeRequiredDescription
namestringyesSecret name.
namespacestringyesNamespace (typically cert-manager).
typestringnoDefault: Opaque.
stringDataobjectone ofPlaintext key/value pairs.
dataobjectone ofPre-base64-encoded values.

clusterIssuers[] and issuers[]

issuers[] adds a required namespace field; otherwise identical.

KeyTypeRequiredDescription
namestringyesIssuer name.
emailstringnoACME account email (optional — Let's Encrypt / cert-manager does not require it).
serverstringyesACME directory URL (use acmeServers.letsencryptProd etc.).
privateKeySecretRefstringnoACME account key secret name. Default: <name>-account-key.
solverslistyescert-manager solvers (DNS-01, HTTP-01) — passthrough.

certificates[]

KeyTypeRequiredDescription
namestringyesCertificate name.
namespacestringyesWhere the Certificate (and resulting TLS Secret) live.
secretNamestringyesName of the TLS Secret cert-manager will create.
issuerRefobjectyes{name, kind} (kind = ClusterIssuer or Issuer).
commonNamestringnoCertificate Common Name.
dnsNameslistnoSAN DNS names.
uris / ipAddresses / emailAddresseslistnoOther SAN types.
durationstringnoDefault 2160h (90d).
renewBeforestringnoDefault 720h (30d).
privateKeyobjectnoAlgorithm/size override.
usageslistnoKey usages (defaults from cert-manager).
isCAboolnoMark cert as a CA.
secretTemplateobjectnoLabels/annotations on the resulting Secret.

ingresses[] (optional)

Optional. Most users keep Ingress in their app chart and just add a cert-manager.io/cluster-issuer annotation; this block exists for the one-shot install pattern (issuer + cert + ingress in one values file).

KeyTypeRequiredDescription
namestringyesIngress name.
namespacestringyesIngress namespace (must match the Certificate's namespace if it shares the TLS Secret).
labelsobjectnoExtra labels.
annotationsobjectnoExtra annotations (typically cert-manager.io/cluster-issuer: <issuer-name>).
ingressClassNamestringnoIngress class (e.g. nginx).
ruleslistnoPassthrough to Ingress.spec.rules (Kubernetes Ingress v1 schema).
tlslistnoPassthrough to Ingress.spec.tls. secretName should match certificates[].secretName.

Notes

Ingress

This chart can optionally create Ingress resources via the ingresses[] block (see examples above). It's off by default because most users keep Ingress in their app chart and only add the cert-manager annotation:

metadata:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  tls:
    - hosts:
        - example.com
      secretName: example-com-tls    # the secretName from your Certificate

cert-manager sees the annotation, looks up the matching Certificate, and ensures the TLS Secret is in place. Use the ingresses[] block only when you want the chart to bundle the Ingress alongside the cert.

Use staging while iterating

Let's Encrypt production has strict rate limits (5 duplicate certs per week). When testing values, point your Certificate at the staging issuer first:

certificates:
  - name: example-com-tls
    issuerRef:
      name: letsencrypt-staging
      kind: ClusterIssuer
    # ...

Once everything works end-to-end, switch issuerRef.name to the prod issuer.

License

Apache-2.0

Deploy certmanager-letsencrypt with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has certmanager-letsencrypt on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcertmanager-letsencrypt is pinned at v0.2.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply