How to rotate ca cert with new root and --force #5613
Replies: 2 comments 2 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.
-
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
https://docs.rke2.io/security/certificates#rotating-custom-ca-certificates
The rotate is successfully but after I run
systemctl restart rke2-server.service
the server never comes back up and and logs showCA cert validation failed: Get "https://127.0.0.1:9345/cacerts" tls: failed to verify certificate x509 certificate signed by unknown authority.
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.
https://docs.rke2.io/security/certificates#rotating-self-signed-ca-certificates
with the same result, it rotates successfully but 509s on restart.
Beta Was this translation helpful? Give feedback.
All reactions