-
Notifications
You must be signed in to change notification settings - Fork 715
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
Switch to generating ECDSA keys #1535
Comments
@fabriziopandini I don't think it's needed as they are different issues: #984 is about kubeadm accepting pre-generated ECDSA certs (without kubeadm) and this issue is about kubeadm generating ECDSA certs itself. |
moving to melestone Next. kubernetes/kubernetes#76390 this ticket tracks the generation of ECDSA by kubeadm.
we probably should define when this transition is going to happen. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
ECDSA keys are significantly faster fwiw, particularly on arm32. I could not enable TLS peering certs on my rPi2 cluster and have the health checks (TLS handshakes) complete in less than the etcd hard-coded connect timeout with RSA keys - ECDSA keys work fine. |
@rojkov thanks for the feedback. |
i think i've seen related issues before. but isn't 15 seconds a bit too much even for rpi? people were considering race conditions at some point on ARM... rpi in general is not supported until we have e2e tests for it.
+1 if @rojkov can get back to this work. |
I might get back to this. Will update tomorrow or on this Wednesday. |
I need to finalize one my PR to Envoy's main repo and one more PR to the OpenSSL extension to Envoy first. They take all my time budget allowed for open source contributions. Then I can continue with ECDSA keys. |
thanks @rojkov |
Submitted kubernetes/kubernetes#86953 |
@rojkov i'm personally in favor of adding this as part of the API, but it means it has to wait until we have enough new features for v1beta3. we might not be able to release v1beta3 this cycle because kubeadm is moving out of k/k and that's where most of the effort will be. if you want to add this as part of kubeadm ASAP, then it has to be a future gate and only work on ideally i wish we support renew paths that support transitioning old certs to ECDSA from RSA, or the other way around for people to opt-out of the feature gate. |
@rojkov thank you! |
Thanks for working on this. What's the rough order of operations to manually move a cluster from RSA to ECDSA. I can guess that there are dependencies on certain flags in components and the communication between those components. (kube-apiserver / kubelet / etcd / ....) Is downtime required in some or all upgrade techniques? (multiple controlplane nodes?) If we can document this with the gated feature, it will serve users and maybe point us toward a more automated behavior. |
@stealthybox It's safe to have keys of different types in a single certificate bundle or chain. I don't expect problems if to add the ECDSA feature gate to |
we decided to not add this as a field in v1beta3, due to some uncertainties around the feature. |
I have generated keys and certificates with the secp256k1, run
Which of the curves are actually supported today? |
AFAIK, RKE does not use kubeadm.
|
This feature is still alpha, the original plan for this is making the ECDSA as the defaults, and deprecated the RSA which I think is breaking change as well.
not sure if we can add this to v1beta4, since I haven't done enough test around this, something we can do for v1beta4 is graduate this feature to beta with RSA still supported, properly, we need to create some e2e testcases for this to be beta. @neolit123 @fabriziopandini @SataQiu @pacoxu and others, WDTY about this? |
my take: re tests: if we add it as a field we need to test it like that. currently it has a dedicted e2e as a FG, i believe. edit: i can work on this if we have agreement. |
thanks @neolit123 ! I am +1 for the idea of cluster level field instead of a FG, so that this won't be a breaking change. |
technically, it will be a breaking change as we will drop the alpha FG. but not breaking in the API, per se. |
PR that adds add v1beta4.ClusterConfiguration.EncryptionAlgorithm is up: |
maybe so |
edit(neolit123)
v1beta4 tasks
add a field to ClusterConfiguration:
kubeadm: add v1beta4.ClusterConfiguration.EncryptionAlgorithm kubernetes#120417
allow various ECDSA/RSA variations:
kubeadm: enhance encryption algorithm support in v1beta4 kubernetes#123054
add kinder e2e test (for latest only)?:
TO-BE-DECIDED, maybe we are OK with just unit tests?
- [ ] remove the feature gate PublicKeysECDSA (same release as v1beta4 or one later max):should be done with the removal of v1beta3 !
FEATURE REQUEST
To unify the type of certificates used across Kubernetes make kubeadm generate ECDSA keys and certificates instead of RSA ones during cluster initialization and key renewal.
Motivation
As explained in OpenSSL wiki the primary advantage of using Elliptic Curve based cryptography is reduced key size and hence speed.
In addition to that kubelet already generates self-signed server certificates of the ECDSA type and uses ECDSA client certificates when communicating with API servers. It would reduce complexity if the same defaults were used across Kubernetes components.
Goals
Proposal
Since people feel more comfortable when there is a transition period it makes sense to introduce a configuration option first for the type of keys used in new clusters or the clusters undergoing upgrades.
The selected key type should be defined in
InitConfiguration
or optionally overridden with a command line option applicable to theinit
command and to thecerts
related subcommands.The function
pkiutil.NewPrivateKey()
should acceptkeyType
parameter of two possible valuesECDSA
andRSA
. The actual value is passed fromInitConfiguration
by callers. Currently the function unconditionally generates RSA keys only.The default value for the option is
RSA
.It is OK to have certificates of mixed types in the same certificate chain thus after two or three releases the default value can be switched to
ECDSA
.After the transition period is over the option can be removed completely and all new keys are going to be of the ECDSA type.
The text was updated successfully, but these errors were encountered: