cnrancher / autok3s

Run K3s Everywhere
https://www.suse.com
Apache License 2.0
741 stars 76 forks source link

[BUG] Expired client certificate causes cluster access failure #676

Open Yzi opened 3 months ago

Yzi commented 3 months ago

Describe the bug Expired client certificate causes cluster access failure.

To reproduce Steps to reproduce the behavior:

  1. Create a cluster. The default client certificate is valid for one year.
  2. Within one year, the k3s version was manually upgraded, but the default client certificate was not updated.
  3. One year later, the client certificate expired, causing access to the cluster to fail.

Expected behavior The client certificate is automatically updated and the cluster can be accessed.

Screenshots If applicable, add screenshots to help explain your problem.

Environments (please complete the following information):

Additional context Add any other context about the problem here.

JacieChao commented 3 months ago

@Yzi Thanks for your feedback.

So can I confirm that the K3s certificate can be rotated automatically by the K3s server, after that, the K3s cluster works properly and you can use kubectl on the K3s server properly? However, AutoK3s is not aware of the certificate change of the K3s cluster. It can't use the existing kubeconfig file(which contains the expired client certificate) to access the K3s cluster.

Yzi commented 3 months ago

The k3s service works normally. Manually download the certificate automatically rotated by the K3s server, then replace the kubeconfig in the autok3s home directory, restart autok3s and restore access to the k3s service.