Feat/k8s config etcd encryption #11641
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Note to the Contributor
I started implementing this feature after reading issue #10899 and more specifically @smira's comment.
As suggested, I created a new
k8sdocument config package, in which I added the newEtcdEncryptionConfigconfig.I made a few assumptions that require validation:
EtcdEncryptionConfigcan be specified per machine configEtcdEncryptionConfig(i.e. if the user uploads a broken etcd config, etcd will crash as a result). we could import k8s upstream types and try to marshal, let me know if it should be done.EtcdEncryptionConfigis specified, talos default etcdencryptionconfig.yamlis completely bypassedsomething else that got me thinking: if there are multiple documents to be added in the future to permit customize all k8s moving parts, wouldn't be smart if instead of creating multiple talos configs to embed the corresponding k8s config we directly allowed specifying the k8s config? with an example, instead of:
directly offer the possibility to use as a patch document
What? (description)
offers a config document based solution for the user to provide a custom
etcd encryption configuration. when specified, the custom encryption
config is applied as-is band it bypases the talos etcd encryption config
Why? (reasoning)
a custom etcd configuration is needed as soon as you want to rotate, or if you want to have more specific parameters than talos defaults (e.g. other encryption scheme, key names, resources to be encrypted, etc)
Acceptance
Please use the following checklist:
make conformance) (GPG key missing)make fmt)make lint)make docs)make unit-tests)