Skip to content

feat: add ca-injector controller for cert-controller-manager-next-generation - #776

Open
janosbinder wants to merge 2 commits into
gardener:masterfrom
janosbinder:feat/ca-injector
Open

feat: add ca-injector controller for cert-controller-manager-next-generation#776
janosbinder wants to merge 2 commits into
gardener:masterfrom
janosbinder:feat/ca-injector

Conversation

@janosbinder

@janosbinder janosbinder commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • This is my first PR and it was generated using AI (Claude by Anthropic) via the Claude Code CLI.
  • Resolves ca-injector feature #185
  • Adds a new cainjector package under pkg/certman2/controller/cainjector/ with four per-kind controllers (ValidatingWebhookConfiguration, MutatingWebhookConfiguration, CustomResourceDefinition, APIService) that automatically populate caBundle fields from a CA source driven by annotations
  • Adds CAInjectorControllerConfig to CertManagerConfiguration (disabled by default; enable with controllers.caInjector.enabled: true)
  • Registers apiregistration/v1 (APIService) in ClusterScheme
  • Wires the controllers into cmd/cert-controller-manager-next-generation/app/app.go
  • Adds docs/usage/ca-injector.md with full feature documentation
  • Adds a ## CA Injector section to README.md

Annotations introduced

Annotation On resource Meaning
cert.gardener.cloud/inject-ca-from Injectable Inject ca.crt from the Secret backing the named Certificate
cert.gardener.cloud/inject-ca-from-secret Injectable Inject ca.crt directly from the named Secret
cert.gardener.cloud/allow-direct-injection Secret Must be "true" to permit direct-secret injection

Test plan

  • 7 Ginkgo specs covering all four resource kinds, both annotation paths, the allow-direct-injection guard, and requeue-on-missing-CA behaviour
  • go test ./pkg/certman2/... — all packages green
  • go build ./cmd/cert-controller-manager-next-generation/... — binary builds clean

…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>
@gardener-prow

gardener-prow Bot commented Jul 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign marc1404 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow Bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Jul 27, 2026
@gardener-prow

gardener-prow Bot commented Jul 27, 2026

Copy link
Copy Markdown

Welcome @janosbinder!

It looks like this is your first PR to gardener/cert-management 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if gardener/cert-management has its own contribution guidelines.

Thank you, and welcome to Gardener. 😃

@gardener-prow gardener-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 27, 2026
@gardener-prow

gardener-prow Bot commented Jul 27, 2026

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@gardener-prow gardener-prow Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 27, 2026

@marc1404 marc1404 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/kind task
/kind enhancement
/ok-to-test

@gardener-prow gardener-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. kind/task General task kind/enhancement Enhancement, improvement, extension and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jul 27, 2026
Regenerates zz_generated.conversion.go, zz_generated.deepcopy.go, and
zz_generated.defaults.go after adding CAInjectorControllerConfig; also
applies goimports formatting to reconciler.go.
@MartinWeindel MartinWeindel self-assigned this Jul 27, 2026
@MartinWeindel

Copy link
Copy Markdown
Member

@janosbinder
Thanks for your effort.
Unfortunately, this PR suggests changes to the next generation of the cert-controller-manager, which is currently incomplete and untested. As we have no resources, further development is currently halted until 2027.
This means, even if we would merge this PR in some final shape, it would not be available in the current (legacy) implementation.

@MartinWeindel

Copy link
Copy Markdown
Member

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 cmd/cert-controller-manager/main.go using configuration and packages from the controller-manager-library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension kind/task General task ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ca-injector feature

3 participants