Alert Runbooks

CertmanagerCertificateRenewalFailed

Description

Certmanager failed to renew certificate.

Cert-manager scheduled a renewal for this certificate, the scheduled time has passed, and the renewal has not completed. The certificate has not expired — this is the early warning, not the outage.


Possible Causes:


Severity estimation

Warning to Critical severity, depending on how much time is left till the current certificate is expiring.

Impact assessment:


Troubleshooting steps

  1. Confirm the validity of the alert

    • Command / Action:
      • if the certificate does not exist the metric is stale and the alert will resolve on its own
      • kubectl get certificate -n <namespace> <name>

      • check up state of cert-manager in grafana

  1. Check certificate resource

    • Command / Action:
      • kubectl describe certificate <name> -n <namespace>

    • Expected result:
      • Certificate expiration date and time displayed
      • Eventlog at the bottom which names the failure
    • additional info
      • possible failures:
        • Failed to create Order
        • waiting for CertificateRequest to be signed
        • presenting challenge

  1. Check CertificateRequest

    • Command / Action:
      • check if cert request was created
      • kubectl get certificaterequest -n <namespace> –sort-by=.metadata.creationTimestamp

      • check CertificateRequest status
      • kubectl describe certificaterequest <latest-certificateRequest> -n <namespace>

      • if CertificateRequest is pending, check issuer or cluster issuer ->kubectl get clusterissuer,issuer -A ->kubectl describe clusterissuer <issuer>
    • Expected result:
      • CertificateRequest with status APPROVED=True / READY=True
        • if no request was created Webhook,cainjector or Controller may be down
    • additional info
      • Issuer not ready usual causes:
        • ACME account registration failed
        • the account private key secret was deleted
        • wrong External Account Binding credentials
        • ACME directory URL is unreachable
      • Every certificate under a not ready issuer is stalled until it recovers

  1. Check order

    • Command / Action:
      • kubectl get order -n <namespace>

      • if order errored cause could be ACME rate limit or network config is prohibiting connection
      • check latest CertificateRequests again for many requests
      • kubectl get certificaterequest -A –sort-by=.metadata.creationTimestamp | tail -30

      • check network availability ->kubectl run -n cert-manager netcheck –rm -it –restart=Never –image=curlimages/curl –
        curl -sSI https://acme-v02.api.letsencrypt.org/directory
    • Expected result:
      • order with STATE=valid
    • additional info:
      • Let’s Encrypt production: 5 duplicate certificates per week, 50 certificates per registered domain per week, 5 failed validations per hostname per hour.

  1. Check challenge

    • Command / Action:
      • get challange
      • kubectl get challenge -n <namespace>

      • kubectl describe challenge <challenge> -n <namespace>

      • if challenge is pending or failing
        • HTTP-01
        • kubectl get ingress,pods -n <namespace> | grep cm-acme

        • check curl from outside the cluster
        • curl -v “http://<domain>/.well-known/acme-challenge/<token>”

        • DNS-01
        • dig +short TXT _acme-challenge.<domain>

        • kubectl describe challenge <challenge> -n <namespace>

    • Expected result:
      • challenge object is not there because it should be resolved
    • additional info
      • HTTP-01 Usual causes:
        • the solver ingress is not picked up by the ingress controller (wrong ingressClassName)
        • a catch-all HTTPS redirect is swallowing /.well-known/
        • a WAF or CDN in front is blocking the path
        • the domain no longer resolves to this cluster.
      • DNS-01 usual causes:
        • rotated or expired provider API credentials
        • the credentials secret in the wrong namespace (a ClusterIssuer reads its secret from the cert-manager namespace, not the Certificate’s namespace)
        • missing CNAME delegation
        • the zone managed elsewhere so the TXT record never lands
        • propagation check timing out.

  1. Force retry

    • Command / Action:
      • kubectl delete certificaterequest <failed-certificaterequest> -n <namespace>

    • Expected result:
      • certificate request resolves
      • insert alert labels to grafana query and check for result
      • returned timestamp should be in the future
    • additional info
      • Never delete the Certificate resource or its secret to force a refresh
      • The existing secret is still serving valid TLS. Deleting it converts a warning into an immediate outage, and the re-issue will hit the same failure you have not fixed yet.

Additional resources