agentleFS
abevzabevz/devops-skills/skills/cert-manager-debug/SKILL.md

cert-manager-debug

Skill0 starsChanged 41 days agoMITView on GitHub

Use when debugging cert-manager certificate issues in Kubernetes — Certificate stuck not Ready, ACME challenge failures (HTTP-01/DNS-01), Let's Encrypt rate limits, renewal not happening, or cert-manager webhook errors. Mention "cert-manager", "certificate not ready", "acme challenge", "let's encrypt", "tls secret" as triggers.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use kubectl describe on the issuer-appropriate resources and cmctl status certificate when available.

    line 18
  2. Distinctive:

    Do not delete certificate resources merely to force another ACME attempt.

    line 22
  3. Distinctive:

    Follow the Workflow, Safety rules, and Quality checklist below.

    line 26
  4. Very specific:

    Use when a cert-manager-managed certificate misbehaves — a Certificate stuck not Ready, an ACME challenge that never validates, TLS that …

    line 36
  5. Very specific:

    Read-only first, always: kubectl get/describe certificate,certificaterequest,order,challenge, issuer,clusterissuer, cmctl status …

    line 91
  6. Very specific:

    Never delete a Certificate's TLS secret or run cmctl renew as a diagnostic — deleting the secret takes the endpoint's TLS down until …

    line 94
  7. Distinctive:

    Never suggest delete/recreate retry loops against Let's Encrypt production — the duplicate certificate limit (5/week per identical name …

    line 97
  8. Distinctive:

    Do not switch an existing production Issuer/ClusterIssuer to the staging URL in place — every certificate under it would renew as untrusted.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

cert-manager Debug

TL;DR checklist

  • Check controller, webhook, and cainjector health.
  • Follow Certificate → CertificateRequest to the deepest error; for ACME issuers, continue through Order → Challenge.
  • Diagnose the configured HTTP-01 or DNS-01 path before proposing a retry.

Key read-only checks

  • Use kubectl describe on the issuer-appropriate resources and cmctl status certificate when available.

Common pitfalls

  • Do not delete certificate resources merely to force another ACME attempt.

Agent procedure

Follow the Workflow, Safety rules, and Quality checklist below.

Quick references

  • references/playbooks.md

Last verified: unverified

When to use

Use when a cert-manager-managed certificate misbehaves — a Certificate stuck not Ready, an ACME challenge that never validates, TLS that expired even though cert-manager is installed, a renewed cert the app still doesn't serve, or kubectl apply failing on cert-manager webhook errors — and the cause needs to be found.

Goal

Pinpoint where issuance fails: Issuer → Certificate → CertificateRequest → served TLS; for ACME issuers, also inspect Order and Challenge. Back the diagnosis with status/events and propose a fix without mutating live secrets, forcing renewals, or burning ACME rate limits.

Workflow

  1. Baseline health first — kubectl get pods -n cert-manager: controller, webhook, and cainjector all Running. A crashlooping webhook explains "nothing cert-manager related can even be applied"; a down controller explains "nothing progresses" with zero errors anywhere.
  2. Walk the chain top-down — kubectl describe the Certificate, then its CertificateRequest; for an ACME issuer, continue through Order and Challenge(s). The deepest resource with an error in status/events names the culprit; quote that exact message. cmctl status certificate <name> -n <ns> reports related resources in one read-only command if cmctl is available.
  3. Issuer readiness — kubectl describe clusterissuer/<name> (or issuer): is it Ready? ACME account registration failures (missing/invalid account key secret, unreachable ACME server) stall every certificate under that issuer at once.
  4. Route by challenge type once a Challenge holds the error:
    • HTTP-01: does the cm-acme-http-solver pod and configured Ingress or Gateway HTTPRoute exist, and is http://<domain>/.well-known/acme-challenge/<token> reachable from the internet? The self-check runs from inside the cluster — hairpin-NAT homelab setups fail it even when the outside world would succeed.
    • DNS-01: is the _acme-challenge.<domain> TXT record visible at the authoritative nameservers? Provider credential errors and split-horizon DNS are the two classic causes.
  5. Check rate limits before any retry — if the error mentions rateLimited, stop: deleting and recreating certificates makes it worse. Point experiments at the Let's Encrypt staging endpoint instead.
  6. Renewal and consumption issues — cert renewed (secret updated, check kubectl get certificate -o wide and the secret's cert dates via openssl) but clients still see the old cert: the consuming workload loads TLS at startup only and needs a rollout; ingress controllers generally pick up secret changes, pods mounting the secret do not.
  7. Correlate and conclude — tie the quoted status/event message to the specific chain link and cause; propose the minimal fix and how to verify issuance end-to-end afterwards.

References

references/playbooks.md — chain-status and error-text → cause → fix tables (Certificate/ Order/Challenge states, HTTP-01 and DNS-01 walkthroughs, Let's Encrypt rate limits, webhook apply failures, renewal/consumption issues). Route there as soon as the chain walk surfaces an error message.

For reviewing TLS posture and secrets handling more broadly, see kubernetes-security and secrets-management. For the ingress resource itself misrouting traffic (as opposed to the certificate on it), start with kubernetes-debug.

Safety rules

  • Read-only first, always: kubectl get/describe certificate,certificaterequest,order,challenge, issuer,clusterissuer, cmctl status certificate, dig/openssl s_client. None of these mutate state.
  • Never delete a Certificate's TLS secret or run cmctl renew as a diagnostic — deleting the secret takes the endpoint's TLS down until reissuance succeeds and counts against ACME rate limits. Propose it explicitly; the user confirms.
  • Never suggest delete/recreate retry loops against Let's Encrypt production — the duplicate certificate limit (5/week per identical name set) can lock issuance for days. Experiments go to the staging endpoint via a separate parallel issuer.
  • Do not switch an existing production Issuer/ClusterIssuer to the staging URL in place — every certificate under it would renew as untrusted.

Output format

## Observations
<controller/webhook health, issuer readiness, from which command>

## Evidence
<chain walk: the deepest failing resource and its quoted status/event message>

## Root cause
## Fix
<manifest/config diff or action, marked as requiring user confirmation to apply>

## Verification
<certificate Ready check + end-to-end proof, e.g. openssl s_client -connect ... -servername ...>

Quality checklist

  • The issuer-appropriate chain (Certificate → CertificateRequest, plus Order → Challenge for ACME) was walked and the deepest error message quoted, not paraphrased
  • For ACME, the challenge type was identified and its specific playbook followed (HTTP-01 external reachability / DNS-01 TXT at authoritative NS)
  • For ACME, rate-limit implications were considered before proposing any delete/retry
  • Only read-only commands were run without confirmation; secret deletion and forced renewal were marked as requiring it
  • The fix includes an end-to-end verification command, not just "the Certificate is Ready"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.