-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to document steps for manual CA certificate generation / rotation #59
Comments
For k3s, these commands generate certificates very close to those generated during a k3s v1.19.5+k3s1 fresh installation (using elliptic curves):
I have noticed two differences:
|
Please provide information to allow us to use an external CA to sign either the RKE2 CA or the individual certs. |
@brandond looks like this isn't going to make it in the milestone; moving to next. |
It would also be nice if we could add the information on
|
Wholesale replacement of the CAs isn't likely to work, since all of the tokens and certificates within the cluster end up signed using the initial CAs. You could should be able to renew or cross-sign them, but that's about it. Use of an intermediate CA isn't currently supported, as the certificate auto-renew code will re-sign the certs using their own key (turning them back into self-signed root CAs) when they are about to expire. |
Yeah - I believe we might need to re-think the big picture of using / providing and managing certificates... having so many different CAs, monitoring and maintaining them / replacing them is not very user and customer friendly and I am still not sure I understand why it was build in a way where we have to have several CAs for each K8S cluster... |
That's how Kubernetes works? Regardless of whether it's self-managed via kubeadm, or a hosted offering such as EKS - they all have multiple self-signed CA certs that are unique to that cluster. |
Yes - I just do not understand the "why" as I do not see the sense behind having so many different CAs... ;-). I would expect an hierarchy with one root CA (self signed or external) and maybe some intermediates in customer environments... I might need to dig deeper... |
So if I followed the steps here: k3s-io/k3s#1868 (comment) And Edit, yes, the answer is yes that does work! |
This is the summary of what we offer for this feature in rke1 compared to rke2 RKE1
K3S/RKE2As explained in the issue, the user will need to issue the certs/keys and place them in the right places before starting rke2/k3s, as for using a custom CA (or real CA), I dont think it will fully work unless you provide the CA cert/key which is not always the case if you are using a real CA (you can only provide a certificate), reference: https://github.com/k3s-io/k3s/blob/master/pkg/daemons/control/deps/deps.go#L553-L556 |
@galal-hussein regarding this point:
How does this compare to RKE1? From this bit of documentation: |
no it just requires the CA which you can get however the key doesnt exist because it belongs to the CA, so rke2 similarly should only check for the ca certificate, however the code right now check for boths |
There is a discussion on this topic at https://stackoverflow.com/questions/67995687/which-of-the-elliptic-curves-are-supported-for-the-kubernetes-certificates |
I have configured k3s cluster with muli-master by having own CA certs & all looks good (followed the link for the same k3s-io/k3s#1868). Rotating of certs also works after restarting k3s on all 3 masters. But what is the process to rotate CA certs, If I rotate CA certs cluster won't start due to etcd issue. Any one tried this before, Please share your experience |
@galal-hussein @brandond Do we plan on doing anything with this for this release or move it to backlog? |
This would be extremely helpful. There is currently a user asking about this for k3s |
@caroline-suse-rancher @brandond @wjimenez5271 as we've been getitng this request a lot I think it makes sense to start looking into it for inclusion into 1.26 |
Documenting custom CA certificate generation is an easy enough task, assuming we can hold on to the requirement that the certs must be generated before the cluster starts. Supporting rotation or renewal of the cluster CAs may be slightly more difficult, as the node join workflow currently checks the hash of the certificate, and any changes (such as extending its expiration) will invalidate that and cause the node to fail to validate the cluster cert next time it restarts, if that node is using the full |
We should also make sure we cover using intermediate CAs, as described at rancher/rke2#3650. |
@brandond @cwayne18 @galal-hussein Seeing if there is an update on this issue. Currently supporting a customer that is requiring for RKE2 deployment |
Addressed by #101 |
We need to document the steps to manually pre-generate CA certs + keys, or update the expiration on existing certs to extend the expiration. Ideally we would also output the CA hash in a format compatible with the
--token
arg ("K10" + SHA256 sum of cert bytes).We don't currently have any documentation on how to do this for either k3s or rke2, but there are some good starting points at:
One important note is that the hash we are using is a SH256 sum of the server's certificate, NOT its public key. This means that any changes to the cert, including extending its expiration, will change the hash and require passing a new
--token
to joining clients if they are to trust it.gz#13930
gz#15095
gz#16112
The text was updated successfully, but these errors were encountered: