Get certificates from CertManager in Kubernetes

Get details of a all certificates in a namespace:

kubectl get secrets --namespace ${NAMESPACE} -o json | jq -r '.items[].data | select(has("tls.crt")) | ."tls.crt"' | base64 -d | openssl x509 -noout -text

Get details of a certificate in a namespace:

kubectl get secrets --namespace ${NAMESPACE} ${SECRET} -o json | jq -r '.data."tls.crt"' | base64 -d | openssl x509 -noout -text

Leave a Reply

Your email address will not be published. Required fields are marked *