Interview Prep/DevSecOps/Certificates, TLS and security incident response

cert-manager renewed the certificate and the Secret has the new `notAfter`, but clients still see the old certificate

IntermediateTroubleshootingCertificates, TLS and security incident response
Answer

Likely causes → The app or proxy loads the certificate once at startup and never reloads it. Or the certificate was copied somewhere else (a cloud LB, a CDN, a different namespace) that cert-manager does not manage.

Diagnose →

kubectl get secret api-tls -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -noout -enddate
echo | openssl s_client -connect api.acme.com:443 -servername api.acme.com 2>/dev/null | openssl x509 -noout -enddate

Fix → Restart or reload the workload, and automate it with Reloader on the Secret or with an app that watches the mounted file. For external endpoints, push the certificate there automatically or use the provider's managed certificates.

Prevent → Monitor the certificate that is actually served (blackbox probe), not just the Secret.

All DevSecOps questions

More on Certificates, TLS and security incident response