How To Validate Kubernetes Root Certificate

1

Lists all ConfigMaps in the current namespace.

kubectl get cm
2

Extracts the Kubernetes root certificate and saves it to a file named ca.crt.

kubectl get cm kube-root-ca.crt -o json | jq -r '.data["ca.crt"]' > ca.crt
3

Checks the validity period of the extracted certificate.

openssl x509 -text -in ./ca.crt -noout | grep --color=auto  -C 2 "Valid"