How To Validate Kubernetes Root Certificate

1

Lists all pods in the current namespace.

kubectl get po
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 of the extracted certificate.

openssl x509 -text -in ./ca.crt -noout | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} --color=auto -C 2 "Valid"