-
I'm trying to set up a K3s server with a predefined token, including the CA hash, during the initialization process. I understand that the token format should be Specifically:
I'm working with a NixOS configuration, but I'm interested in the general approach that would work for any system. Thank you for your help and for maintaining this great project! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You'd need to start K3s using custom certificates as documented at https://docs.k3s.io/cli/certificate#using-custom-ca-certificates, so that the CA hash is known. If you are using the CA certificates generated by K3s, there is no way to know what the CA hash will be until K3s is started the first time and the certificate is generated. If you don't want to generate custom certificates, then just specify the passphrase when starting the server. If you care, you can update the token to include the CA hash later, after it's started up the first time. |
Beta Was this translation helpful? Give feedback.
You'd need to start K3s using custom certificates as documented at https://docs.k3s.io/cli/certificate#using-custom-ca-certificates, so that the CA hash is known. If you are using the CA certificates generated by K3s, there is no way to know what the CA hash will be until K3s is started the first time and the certificate is generated.
If you don't want to generate custom certificates, then just specify the passphrase when starting the server. If you care, you can update the token to include the CA hash later, after it's started up the first time.