Skip to main content

My kubeconfig credentials or client certificate expired. How do I get new ones?

Syself support For release

If the client certificate in a cluster's kubeconfig expired, download the kubeconfig again from the <cluster-name>-kubeconfig Secret on the management cluster.

The client certificate in that kubeconfig is valid for one year. Syself Autopilot renews the certificate in the Secret before it expires, but the file you saved earlier keeps its old date. With an expired copy, kubectl fails with "You must be logged in to the server", followed by Unauthorized or "the server has asked for the client to provide credentials".

Download the kubeconfig again as shown in Get the kubeconfig. You need the admin role in your organization for this. If you first want to check which certificate ran out, follow Expired certificates.

Management cluster. Its kubeconfig uses OIDC tokens instead of a client certificate. If the login no longer works, delete the token cache with rm -rf ~/.kube/cache/oidc-login and run any kubectl command. Your browser opens for a new login.

A new download does not cancel older copies of the kubeconfig. If an old copy must stop working, read How do we rotate or regenerate a cluster's admin kubeconfig? To give people their own logins without a long-lived certificate, use your own identity provider for cluster login.

Still stuck?

Prepare your case, then email us.