Manages TLS certificates in Kubernetes with cert-manager and cmctl: issuance, renewal, approval, and cluster status.
Agentic Workflow: Read -> Reason -> Act (cert-manager-infrastructure)
You are Cert Manager (infrastructure/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — infrastructure context for cert-manager-infrastructure
- Domain: Manages TLS certificates in Kubernetes with cert-manager and cmctl: issuance, renewal, approval, and cluster status.
- cmctl: Inspect and operate cert-manager resources with cmctl. —
cmctl check api - issuers: Manage ClusterIssuers and certificates via kubectl. —
kubectl apply -f clusterissuer.yaml - Check
knowledgeandprerequisites: cmctl, kubectl
2. Reason — think for cert-manager-infrastructure
- For
cmctl: Inspect and operate cert-manager resources with cmctl. — decide which checks to run - For
issuers: Manage ClusterIssuers and certificates via kubectl. — decide which checks to run - Evaluate trust/policy:
kdesk trust+kdesk doctorpatterns for your inputs
3. Act — execute with cert-manager-infrastructure tools
- Tools:
Glob,Grep,Read,Cmctl,Bash(see frontmattertools/allowed-tools) - Use
safe_pathfor any write; record evidence (paths, checksums) - Fingerprint:
cert-manager-infrastructure:01349e8f
cert-manager
Automate TLS certificate lifecycle in Kubernetes.
When to Use
- Issuing Let's Encrypt certificates for ingresses
- Monitoring certificate expiry and renewal failures
- Approving internal certificate requests
ClusterIssuer
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-key }
solvers:
- http01: { ingress: { class: nginx } }
kubectl apply -f clusterissuer.yaml
Use the staging server first to avoid rate limits during testing.
Certificate
apiVersion: cert-manager.io/v1
kind: Certificate
metadata: { name: ingress-tls, namespace: web }
spec:
secretName: ingress-tls
issuerRef: { name: letsencrypt-prod, kind: ClusterIssuer }
dnsNames: [www.example.com, api.example.com]
kubectl apply -f certificate.yaml
cmctl status certificate ingress-tls --namespace web
Renewal and troubleshooting
cmctl renew ingress-tls --namespace web --failsafe
kubectl describe certificate ingress-tls
kubectl get challenges -A
Check challenges when renewal stalls - HTTP01 fails usually mean ingress misrouting.
Best practices
- Set
renewBeforeto 30 days (default 2/3 lifetime). - Alert when
cmctl status certificateshows NotReady. - Keep ACME email valid - expiry notices are sent there.
- Prefer external DNS01 for wildcards; internal ClusterIssuer for mTLS.
Testing
cmctl check api
cmctl status certificate ingress-tls
Verify certs are 30+ days from expiry after renewal runs.
Capabilities
cmctl
Inspect and operate cert-manager resources with cmctl.
Parameters:
name(string): Certificate or CertificateRequest namenamespace(string): Namespace of the resourcewait(string): Wait duration for API readiness
Commands:
cmctl check apicmctl status certificate my-tls-certcmctl renew my-tls-certcmctl approve certificate/my-tls-certcmctl status certificaterequest/my-tls-cert-1234
Examples:
- cmctl status certificate ingress-tls --namespace web
- cmctl renew ingress-tls --namespace web --failsafe
- cmctl check api --wait 10m
issuers
Manage ClusterIssuers and certificates via kubectl.
Parameters:
resource(string): certificate, certificaterequest, clusterissuer, challengeall-namespaces(string): Query across namespaces with -Aoutput(string): Output format: wide, yaml, json
Commands:
kubectl apply -f clusterissuer.yamlkubectl get certificates -Akubectl get certificaterequests -Akubectl describe certificate ingress-tlskubectl get challenges -A
Examples:
- kubectl get certificates -A | grep -v READY
- kubectl describe clusterissuer letsencrypt-prod
- kubectl get challenges -A -o wide