Certificate Rotation and Expiry
What you'll learn: How service meshes automatically renew security certificates before they expire and how to monitor and troubleshoot certificate lifecycle issues.
Why Certificates Need Rotation
In a service mesh using mTLS, every service has a certificate that proves its identity. Like a passport, these certificates have an expiration date for security reasons. If a certificate expires, the service can't establish secure connections—it's locked out of the mesh.
Think of certificate rotation like automatically renewing your driver's license before it expires, so you never have a gap in your ability to drive.
Automatic Certificate Rotation
Service meshes like Istio handle certificate rotation automatically:
- Certificates are issued with a short lifespan (often 24 hours)
- The control plane monitors certificate age
- Before expiry (typically at 50-75% of lifetime), the sidecar proxy requests a new certificate
- The new certificate replaces the old one seamlessly, with zero downtime
- Old certificates are gracefully phased out
This continuous renewal happens in the background without service interruption.
Monitoring Certificate Health
You should monitor:
- Certificate expiration time: How much time remains before expiry
- Rotation success rate: Are renewals completing successfully?
- Certificate age distribution: Are some services holding expired certificates?
- Control plane health: Is the certificate authority (CA) responsive?
Use Prometheus metrics and alerting to catch issues before they cause outages.
Troubleshooting Expiry Issues
Common problems include:
- Clock skew: Mismatched system clocks between nodes can cause premature expiration
- CA unavailability: If the control plane is down, proxies can't renew certificates
- Network partitions: Isolated pods can't reach the CA for renewal
- Configuration errors: Incorrect certificate lifetimes or rotation thresholds
Check proxy logs, verify control plane connectivity, and ensure time synchronization across your cluster.
Key Takeaway: Service mesh automatic certificate rotation keeps mTLS secure by continuously renewing short-lived certificates, but you must monitor certificate health and maintain control plane availability to prevent expiry-related outages.