Skip to content

View TLS certificates in Kubernetes

Why

If you're using a service like Cert manager, you may want to check the certificate is as you'd expect

How

Get TLS Secrets

kubectl get secrets --field-selector type=kubernetes.io/tls

Replace <name> with the secret name.

kubectl get secret/<name> -o json | jq -r '.data."tls.crt"' | base64 -d | openssl x509 -noout -text

Additional Reading

https://blog.kubovy.eu/2020/05/16/retrieve-tls-certificates-from-kubernetes/ ⧉


Want to make this site better? Open a PR or help fund hosting costs