Overview
Manages the full lifecycle of SSL/TLS certificates: provisioning via Let's Encrypt (HTTP-01 and DNS-01 challenges), wildcard certificates, automated renewal, Kubernetes cert-manager integration, monitoring of expiry, and troubleshooting failed renewals. Includes cron jobs, hooks, and multi-domain (SAN) setups.
When to Use This Skill
- Adding HTTPS to a domain or subdomain for the first time.
- Setting up wildcard certs (
*.example.com).
- Automating renewal for many certificates.
- Deploying to Kubernetes.
Prerequisites
- Domain control (DNS or web server for challenge).
- For DNS challenge: API access to DNS provider (Cloudflare, Route53, etc.).
- Nginx, Caddy, or ingress controller that can use the certificates.
Steps
Choose challenge type:
- HTTP-01: Easy for single domains when you control the web server.
- DNS-01: Required for wildcards and when you don't want to expose port 80.
Provision with certbot (standalone or webroot):
certbot certonly --nginx -d example.com -d www.example.com
# or DNS
certbot certonly --dns-cloudflare -d '*.example.com' -d example.com
Automated renewal:
- certbot renew runs twice a day via systemd timer or cron.
- Use
--deploy-hook to reload Nginx or restart services after successful renew.
Kubernetes (cert-manager):
- Install cert-manager.
- Create Issuer or ClusterIssuer (Let's Encrypt production/staging).
- Create Certificate resources or use annotations on Ingress.
- Wildcard via DNS01 solver with Cloudflare or Route53 secret.
Monitoring & alerting:
- Check certificate expiry (e.g., with
certbot certificates or Prometheus blackbox / cert-exporter).
- Alert when < 30 days remaining.
Multi-domain (SAN):
- List all domains in one certificate when they share the same server.
Output:
- Exact certbot commands for the domains.
- Systemd timer or cron for renewal + deploy hook.
- cert-manager YAML for Kubernetes.
- Expiry monitoring script or Prometheus rule.
- Troubleshooting steps for common renewal failures (rate limits, DNS propagation, webroot path wrong).
Examples
Full certbot commands for single + wildcard, a production renewal cron with deploy hook that reloads Nginx, and a complete cert-manager setup for a Kubernetes Ingress with wildcard are included.
Edge Cases & Error Handling
- Rate limits: Use staging for testing (
--staging), respect 50 certs/week per domain for production.
- DNS propagation: For DNS-01, wait or use a provider with fast propagation.
- Certificate not picked up: Check file permissions and service reload.
- Revocation: Have a process to revoke and re-issue if key is compromised.
Verification
https://example.com shows a valid certificate (padlock, not self-signed).
certbot certificates shows the cert and next renewal date.
- Renewal test:
certbot renew --dry-run succeeds.
- In Kubernetes:
kubectl get certificate shows Ready=True.
- Expiry alert would fire if the cert were close to expiring.
- Success: All domains have valid, auto-renewing certificates with >30 days validity at all times.
References
1---2name: ssl-certificate-manager3description: Manages SSL/TLS certificates including provisioning, renewal, and multi-domain setup. Use when configuring HTTPS for any domain.4license: Apache-2.05compatibility: Claude Code, Codex, Gemini CLI6metadata:7 author: ai-skills8 version: "1.0"9 category: devops10 tags: ssl, tls, lets-encrypt, certbot, cert-manager, wildcard, renewal11---1213## Overview1415Manages the full lifecycle of SSL/TLS certificates: provisioning via Let's Encrypt (HTTP-01 and DNS-01 challenges), wildcard certificates, automated renewal, Kubernetes cert-manager integration, monitoring of expiry, and troubleshooting failed renewals. Includes cron jobs, hooks, and multi-domain (SAN) setups.1617## When to Use This Skill1819- Adding HTTPS to a domain or subdomain for the first time.20- Setting up wildcard certs (`*.example.com`).21- Automating renewal for many certificates.22- Deploying to Kubernetes.2324## Prerequisites2526- Domain control (DNS or web server for challenge).27- For DNS challenge: API access to DNS provider (Cloudflare, Route53, etc.).28- Nginx, Caddy, or ingress controller that can use the certificates.2930## Steps31321. **Choose challenge type**:33 - HTTP-01: Easy for single domains when you control the web server.34 - DNS-01: Required for wildcards and when you don't want to expose port 80.35362. **Provision with certbot (standalone or webroot)**:37 ```bash38 certbot certonly --nginx -d example.com -d www.example.com39 # or DNS40 certbot certonly --dns-cloudflare -d '*.example.com' -d example.com41 ```42433. **Automated renewal**:44 - certbot renew runs twice a day via systemd timer or cron.45 - Use `--deploy-hook` to reload Nginx or restart services after successful renew.46474. **Kubernetes (cert-manager)**:48 - Install cert-manager.49 - Create Issuer or ClusterIssuer (Let's Encrypt production/staging).50 - Create Certificate resources or use annotations on Ingress.51 - Wildcard via DNS01 solver with Cloudflare or Route53 secret.52535. **Monitoring & alerting**:54 - Check certificate expiry (e.g., with `certbot certificates` or Prometheus blackbox / cert-exporter).55 - Alert when < 30 days remaining.56576. **Multi-domain (SAN)**:58 - List all domains in one certificate when they share the same server.59607. **Output**:61 - Exact certbot commands for the domains.62 - Systemd timer or cron for renewal + deploy hook.63 - cert-manager YAML for Kubernetes.64 - Expiry monitoring script or Prometheus rule.65 - Troubleshooting steps for common renewal failures (rate limits, DNS propagation, webroot path wrong).6667## Examples6869Full certbot commands for single + wildcard, a production renewal cron with deploy hook that reloads Nginx, and a complete cert-manager setup for a Kubernetes Ingress with wildcard are included.7071## Edge Cases & Error Handling7273- **Rate limits**: Use staging for testing (`--staging`), respect 50 certs/week per domain for production.74- **DNS propagation**: For DNS-01, wait or use a provider with fast propagation.75- **Certificate not picked up**: Check file permissions and service reload.76- **Revocation**: Have a process to revoke and re-issue if key is compromised.7778## Verification79801. `https://example.com` shows a valid certificate (padlock, not self-signed).812. `certbot certificates` shows the cert and next renewal date.823. Renewal test: `certbot renew --dry-run` succeeds.834. In Kubernetes: `kubectl get certificate` shows Ready=True.845. Expiry alert would fire if the cert were close to expiring.856. Success: All domains have valid, auto-renewing certificates with >30 days validity at all times.8687## References8889- [Let's Encrypt](https://letsencrypt.org/)90- [certbot](https://certbot.eff.org/)91- [cert-manager](https://cert-manager.io/)92- [Mozilla SSL Config](https://ssl-config.mozilla.org/)