We generate the kubeconfig for kubernetes cluster from a web UI. Some users are complaining that their kubeconfig file is not working. We need to know the expiry date of the token from kubeconfig file. We would want to advise the users to regenerate the kubeconfig if we know how long the kubeconfig is valid.
Asked
Active
Viewed 1,913 times
0
-
I assume you are using cert auth. In that case, you can extract the client certificate from the kubeconfig (it can either be inline as a base64 or point to an external file) and get the expiration date out of the PEM using `openssl x509 -in
-noout -text | grep "Not After"` – whites11 May 25 '22 at 11:53
1 Answers
0
you can verify the configured expiry time of the kubeconfig token within the Rancher UI, under API & Keys . Once the token expires, you will be prompted to log in again upon executing kubectl commands against the cluster.
Please find the document for more information.

Ramesh kollisetty
- 245
- 1
- 7