Skip to content

Expired kubeconfig and control plane certs – how to renew in kube-hetzner setup? #1713

Answered by steand94
steand94 asked this question in Q&A
Discussion options

You must be logged in to vote

For those who faced the same issue and have doubts about how to manage this situation correctly :)

The simple answer

Just run:

terraform apply

After completion, you will get an updated kubeconfig with renewed certificate:

terraform output kubeconfig

The long answer

K3s automatically rotates certificates about 90 days before expiration (see https://docs.k3s.io/cli/certificate). The updated certificates are stored at:

/var/lib/rancher/k3s/server/tls

And a new kubeconfig is generated at:

/etc/rancher/k3s/k3s.yaml

To manually retrieve and use it:

  1. SSH into the first control plane node:
ssh root@<server-ip> -i ./path/to/privatekey -o StrictHostKeyChecking=no
  1. Open the kubeconfig with ren…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by steand94
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@steand94
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants