feat: add ca-injector controller for cert-controller-manager-next-generation - #776
feat: add ca-injector controller for cert-controller-manager-next-generation#776janosbinder wants to merge 2 commits into
Conversation
…eration Implements the ca-injector feature (issue gardener#185) for the next-generation binary, automatically populating caBundle fields of injectable Kubernetes resources from a CA source driven by annotations. Co-authored-by: Claude <claude@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @janosbinder! |
|
Hi @janosbinder. Thanks for your PR. I'm waiting for a gardener member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
marc1404
left a comment
There was a problem hiding this comment.
/kind task
/kind enhancement
/ok-to-test
Regenerates zz_generated.conversion.go, zz_generated.deepcopy.go, and zz_generated.defaults.go after adding CAInjectorControllerConfig; also applies goimports formatting to reconciler.go.
|
@janosbinder |
|
As the legacy controller is based on the legacy controller-manager-library, an implementation of this feature would look quite different. It needs to be integrated into |
|
The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle stale |
Port the CA injector feature (PR #776, next-generation binary) to the legacy cert-controller-manager using controller-manager-library patterns. Four CML controllers (one per injectable kind) populate the caBundle of ValidatingWebhookConfiguration, MutatingWebhookConfiguration, CustomResourceDefinition conversion webhooks and APIServices from a CA source driven by annotations: - cert.gardener.cloud/inject-ca-from: <ns>/<certificate> - cert.gardener.cloud/inject-ca-from-secret: <ns>/<secret> (guarded by cert.gardener.cloud/allow-direct-injection=true) The controllers watch the source cluster and additionally watch Certificate and Secret resources, maintaining a reverse index so CA rotations and late-created secrets re-trigger injection. They are registered with ActivateExplicitly under the new certcainjector group, so they only run when explicitly enabled via --controllers. Register the admissionregistration, apiextensions and kube-aggregator schemes in main.go, gate the additional RBAC behind a new configuration.caInjectorEnabled chart value, and add Ginkgo tests. Co-Authored-By: Claude <noreply@anthropic.com>
Summary
cainjectorpackage underpkg/certman2/controller/cainjector/with four per-kind controllers (ValidatingWebhookConfiguration,MutatingWebhookConfiguration,CustomResourceDefinition,APIService) that automatically populatecaBundlefields from a CA source driven by annotationsCAInjectorControllerConfigtoCertManagerConfiguration(disabled by default; enable withcontrollers.caInjector.enabled: true)apiregistration/v1(APIService) inClusterSchemecmd/cert-controller-manager-next-generation/app/app.godocs/usage/ca-injector.mdwith full feature documentation## CA Injectorsection toREADME.mdAnnotations introduced
cert.gardener.cloud/inject-ca-fromca.crtfrom the Secret backing the namedCertificatecert.gardener.cloud/inject-ca-from-secretca.crtdirectly from the namedSecretcert.gardener.cloud/allow-direct-injection"true"to permit direct-secret injectionTest plan
allow-direct-injectionguard, and requeue-on-missing-CA behaviourgo test ./pkg/certman2/...— all packages greengo build ./cmd/cert-controller-manager-next-generation/...— binary builds clean