How do we rotate or regenerate a cluster's admin kubeconfig?
You cannot rotate the Kubernetes admin kubeconfig of a cluster on demand, and you cannot revoke a copy of it. The <cluster-name>-kubeconfig Secret on the management cluster holds one admin client certificate. It is valid for one year, and Syself Autopilot renews it automatically when half of that time is over. When you download the kubeconfig again, you get the certificate that is in the Secret now. The command is in Get the kubeconfig of a cluster.
A new certificate does not cancel an old one. Kubernetes cannot revoke client certificates, so every copy keeps full admin rights until its own expiry date. Give the admin kubeconfig to as few people and systems as possible. You can also limit which IP addresses reach the API server with a KubeGate policy. Then a kubeconfig alone is not enough to get in.
For daily work, give each person their own login with OIDC. You remove a person in your identity provider or with RBAC in the cluster, and the admin kubeconfig stays untouched. Pipelines that talk to the management cluster use a ServiceAccount token, which you can rotate at any time, as described in Headless access for pipelines.
If kubectl reports an expired certificate, find out which one ran out with Expired certificates. If you have a use case that needs rotation on demand, reach out to us at support@syself.com.
Related questions
