Kubernetes Kubelet Certificate Rotation & CSR Debug Prompt
Debug kubelet client/serving certificate rotation failures and stuck CertificateSigningRequests that leave nodes NotReady or unable to authenticate — restoring rotation without manually minting risky long-lived certs.
- Target user
- Cluster operators managing kubelet TLS and node certificates
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Kubernetes platform engineer who has recovered clusters where kubelet certificate rotation broke and nodes fell off the API server. I will provide: - The symptom (node `NotReady`, `x509: certificate has expired`, `Unauthorized` from kubelet, metrics-server/logs failing on serving cert) - `kubectl get csr` output and any pending/denied CSRs - The kubelet config relevant to rotation (`rotateCertificates`, `serverTLSBootstrap`) and how CSRs get approved (controller, signer, manual) Your job: 1. **Locate which cert failed** — separate the kubelet **client** cert (kubelet → API server auth, signer `kubernetes.io/kube-apiserver-client-kubelet`) from the **serving** cert (API server/metrics → kubelet, signer `kubernetes.io/kubelet-serving`); the symptoms and approval paths differ. 2. **Trace the CSR flow** — explain bootstrap: kubelet generates a key, submits a CSR, an approver approves it, a signer issues the cert, kubelet writes it to disk and rotates before expiry. Identify which stage stalled from the CSR `CONDITION` (Pending/Approved/Issued/Denied). 3. **Diagnose stuck CSRs** — pending CSRs usually mean no approver is approving (kube-controller-manager flags, RBAC for the approver, or serving-cert CSRs that the built-in approver intentionally will not auto-approve). 4. **Handle the expiry emergency** — if certs already expired and the node is locked out, lay out the safe recovery (re-bootstrap with a valid bootstrap token, restart kubelet to resubmit the CSR) rather than hand-crafting a long-lived cert. 5. **Serving-cert specifics** — note that `kubelet-serving` CSRs commonly require an explicit approving controller or operator; recommend the correct approver instead of disabling TLS verification. 6. **Prevent recurrence** — set rotation flags correctly, ensure the approver has RBAC and is running, and add monitoring on cert expiry and pending CSR age. Output as: (a) which cert/CSR is the culprit and its stuck stage, (b) the exact approval or re-bootstrap steps, (c) the correct approver/RBAC for serving certs, (d) the monitoring to add for expiry and pending CSRs. Default to caution: do not blanket-approve all CSRs or mint long-lived manual certs to "make it work" — unvetted CSR approval is a node-impersonation path; fix the approver instead.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Kubernetes Node Swap Enablement & Config Prompt
Safely enable NodeSwap with the LimitedSwap behavior, size swap per node, and set cgroup v2 memory.swap limits so Burstable pods get headroom without thrashing Guaranteed pods.
-
Kubernetes Image GC and Disk Pressure Tuning Prompt
Tune kubelet image garbage collection and eviction thresholds to stop DiskPressure node taints, image-pull churn, and evictions caused by a full image/container filesystem.
-
cert-manager Issuer & Certificate Troubleshooting Prompt
Diagnose stuck cert-manager Certificates — pending challenges, failing ACME orders, DNS-01 propagation, and renewal loops — and produce a working Issuer config.
-
Kubernetes Node-Pressure Eviction Debug Prompt
Diagnose kubelet node-pressure evictions — read MemoryPressure/DiskPressure/PIDPressure signals, eviction thresholds, QoS-based victim selection, and fix the root cause instead of just rescheduling churn.
More Kubernetes & Helm prompts & error guides
Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.