How to rotate ca cert with new root and --force #5613
-
I am on rke2 2.24.17, and I am trying to rotate the ca cert with a newly generated ca certs. We want to invalidate the old certs/kube config so we do NOT want it cross signed. I've followed the step here modified for my needs and am running this on the first server
The rotate is successfully but after I run
This section also mentions
which seems to be a copy paste error cause the generate-custom-ca-certs does not output a new token. I then tried these steps modifying the rotate script to not copy and use the old ones. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
yes, generate-custom-ca-certs was intended to be used before initial cluster startup. Using that that to switch from the default self-signed certs, to custom certs, is not something that we've tested. You'll need to calculate the hash yourself, and update the hash in the token files by hand. |
Beta Was this translation helpful? Give feedback.
-
I have been able to rotate successfully once, subsequent attempts after all the nodes are up fail. I ran across this comment k3s-io/k3s#8952 (comment) Which got me thinking to modify the Adding an If around ${TYPE}-ca.crt creation
then running
once up, updating the config on each server/agent to the new token and then rebooting them. Once they are all rebooted, the original kubeconfig has become invalidated. |
Beta Was this translation helpful? Give feedback.
yes, generate-custom-ca-certs was intended to be used before initial cluster startup. Using that that to switch from the default self-signed certs, to custom certs, is not something that we've tested. You'll need to calculate the hash yourself, and update the hash in the token files by hand.