Let’s Encrypt on Kubernetes: how cert-manager works, and how to monitor it

Issuer, Certificate, HTTP-01 and DNS-01 challenges, renewal at two thirds: the path of a Let’s Encrypt certificate in Kubernetes, and how to monitor it.

Published · 7 min read · Also available in: Français

In a Kubernetes cluster, nobody runs certbot by hand. Let’s Encrypt certificates are requested, installed and renewed by a component of the cluster, almost always cert-manager. When everything works, you forget about it. That is exactly the risk: the day renewal fails, nothing warns you.

This article follows a certificate from request to renewal, then answers the question that naturally follows: can these certificates be monitored, and how?

The moving parts

Part Role
Let’s Encrypt The certificate authority. It issues the certificate after checking that you control the domain, through the ACME protocol.
cert-manager The ACME client, installed in the cluster. It talks to Let’s Encrypt on your behalf.
Issuer / ClusterIssuer The declaration of which authority to use: ACME server address, account, validation method. An Issuer applies to one namespace, a ClusterIssuer to the whole cluster.
Certificate The request: which domain names, and which Secret receives the result.
Secret Where the certificate and its private key land (type kubernetes.io/tls, keys tls.crt and tls.key).
Ingress or Gateway The entry point for traffic. It reads the Secret to serve the certificate.

The path of a request

  1. You create a Certificate resource, or annotate an Ingress, which amounts to the same thing.
  2. cert-manager generates a private key and a CertificateRequest.
  3. For an ACME authority, it creates an Order resource (the order placed with Let’s Encrypt), then one Challenge per domain name to prove.
  4. It solves each challenge, HTTP-01 or DNS-01 depending on the configuration.
  5. Let’s Encrypt checks, then signs the certificate.
  6. cert-manager stores the certificate and the key in the Secret. The Ingress serves it.

The private key is created in the cluster and never leaves it: Let’s Encrypt only receives the signing request.

  1. CertificateYou declare the certificate you want, or annotate an Ingress.
  2. CertificateRequestcert-manager creates the private key and the signing request.
  3. OrderThe order placed with Let’s Encrypt.
  4. ChallengeOne challenge per domain name, solved through HTTP-01 or DNS-01.
  5. SecretThe certificate and key are stored there; the Ingress serves them.
The Kubernetes resources created, in order, to obtain a certificate.

Declaring Let’s Encrypt

One ClusterIssuer is enough for the whole cluster:

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: ops@example.com
    privateKeySecretRef:
      name: letsencrypt-prod-account-key
    solvers:
      - http01:
          ingress:
            ingressClassName: traefik   # your Ingress controller's class

The letsencrypt-prod-account-key Secret holds the key of your ACME account. It has nothing to do with your certificates’ keys, but you need to keep it: it is what identifies you to Let’s Encrypt.

Requesting a certificate

The most common way is to let the Ingress ask for it. One annotation and a tls block are enough:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: site
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  ingressClassName: traefik
  tls:
    - hosts:
        - www.example.com
      secretName: www-example-com-tls
  rules:
    - host: www.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: site
                port:
                  number: 80

A sub-component of cert-manager, ingress-shim, reads the annotation and creates the matching Certificate resource. The names listed under hosts become the certificate’s names, and each Ingress must have its own secretName.

HTTP-01 or DNS-01 in a cluster

HTTP-01. cert-manager starts a temporary pod (acmesolver), with its Service and an Ingress rule, to answer at /.well-known/acme-challenge/…. Port 80 of the cluster must therefore be reachable from the Internet. It is the easiest to set up, but it cannot issue wildcard certificates.

DNS-01. cert-manager creates a TXT record in your DNS zone, through your provider’s API. Supported natively: ACME-DNS, Akamai, Azure DNS, Cloudflare, Google Cloud DNS, Route 53, DigitalOcean and RFC 2136. The others go through community-maintained webhooks. It is the only way to get a wildcard, and the only one that works when the cluster is not exposed.

Two things to know before choosing:

Renewal

By default, cert-manager renews a certificate two thirds of the way through its lifetime. For a 90-day Let’s Encrypt certificate, that falls around day 60, which is 30 days before expiry. This is also what Let’s Encrypt recommends.

You do not control the lifetime: at Let’s Encrypt it is set by the authority, with no exceptions. And it is getting shorter. The announced schedule:

Date Announced change
May 13, 2026 The opt-in tlsserver profile moves to 45 days
February 10, 2027 The default profile moves to 64 days; a domain validation can only be reused for 10 days
February 16, 2028 The default profile moves to 45 days; a validation can only be reused for 7 hours

An opt-in profile already issues 6-day certificates. In cert-manager, the profile is chosen in the Issuer (profile field, from version 1.18).

The consequence is the same as for the general move to 47 days: more renewals, hence more chances to fail, and less margin when it happens.

What breaks

An automatic renewal can fail for reasons that have nothing to do with the certificate:

For your tests, use Let’s Encrypt’s staging environment (https://acme-staging-v02.api.letsencrypt.org/directory). Its limits are far higher, but its certificates are not trusted by browsers.

Troubleshooting

The cert-manager documentation suggests walking down the chain, resource by resource:

kubectl get clusterissuer                     # is the authority ready?
kubectl describe certificaterequest <name>    # did the request create an order?
kubectl describe order <name>                 # where did the order stop?
kubectl describe challenge <name>             # why does the challenge fail?

The useful message is most often in the Challenge.

Can these certificates be monitored?

Yes, and they should be. Since June 4, 2025, Let’s Encrypt no longer sends an email before a certificate expires. If renewal fails silently, the first to know is your user.

There are two ways to monitor, and they do not answer the same question.

From inside the cluster. cert-manager exposes Prometheus metrics (port 9402), and its documentation points to a community set of alerts. This is useful, but that monitoring depends on the cluster it watches: if cert-manager or Prometheus is down, so is the alert. And it only sees that one cluster.

From outside. An independent tool looks at the certificate your visitors actually receive. That is what PkiZen does, in three ways:

Means What it sees For which certificates
TLS scan of your public names The certificate actually served by the Ingress, on every pass Any service reachable from the Internet
Certificate Transparency Every certificate issued for your domains, by any cluster Public certificates, including those of a cluster you had lost track of
API import The certificate you send it Internal services, which the scan cannot reach

A Let’s Encrypt certificate is recognized as automatically renewed. So PkiZen does not bother you at 30 days: it alerts at 7 days or less, when renewal should already have happened. An alert then means “the automation failed”, not “remember to renew”.

For an internal service, a scheduled job can push the public part of the Secret:

kubectl get secret www-example-com-tls -n web -o jsonpath='{.data.tls\.crt}' | base64 -d > cert.pem

jq -n --rawfile pem cert.pem \
  '{pem: $pem, name: "www-example-com-tls", installedOn: ["prod cluster / web namespace"]}' \
  | curl -sS -X PUT "$CLM_API_URL/certificates" \
      -H "Authorization: Bearer $CLM_TOKEN" -H "Content-Type: application/json" -d @-

The API address and the token are on the API import page of the application. Only tls.crt is sent: tls.key, the private key, never leaves the cluster.

What PkiZen does not do: it installs nothing in the cluster, does not read your Secrets and renews nothing. That is a choice, explained in Why we monitor your certificates without renewing them.

In short

References: cert-manager documentation (ACME configuration, HTTP-01, DNS-01, Ingress, troubleshooting); Let’s Encrypt: rate limits, staging environment, end of expiration emails, from 90 to 45 days.