Add support for injecting CA from secret for trust manager Webhook#762
Add support for injecting CA from secret for trust manager Webhook#762zeusal wants to merge 5 commits intocert-manager:mainfrom
Conversation
Add support for injecting CA from Secret, allowing cainjector to run with --enable-certificates-data-source=false as recommended by best practices Signed-off-by: Zeus Arias Lucero <33123154+zeusal@users.noreply.github.com>
Added default value with description Signed-off-by: Zeus Arias Lucero <33123154+zeusal@users.noreply.github.com>
Move into app.webhook.tls Signed-off-by: Zeus Arias Lucero <33123154+zeusal@users.noreply.github.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 |
|
Hi @zeusal. Thanks for your PR. I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with 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. |
Fix typo issue Signed-off-by: Zeus Arias Lucero <33123154+zeusal@users.noreply.github.com>
Add values.schema Signed-off-by: Zeus Arias Lucero <33123154+zeusal@users.noreply.github.com>
|
@zeusal, did you also read the note in https://cert-manager.io/docs/installation/best-practice/#memory?
|
Yes, I did read the note in the best practices guide. The MR is aligned with it: by allowing inject-ca-from-secret, we can keep running cainjector with --enable-certificates-data-source=false, so the CA is injected from a pre-generated secret instead of generating certificates in the pod. This follows the memory and security recommendations from the guide. The MR doesn’t change the default behavior — it only adds an optional way to provide the CA from a secret, keeping the pod lightweight and compliant with the best practices. With this change, the chart can natively support both behaviors. It allows avoiding certificate auto-discovery and additional watchers, while still letting the MutationWebhook obtain the CA from a secret by specifying ca-from-secret and setting cert-manager.io/allow-direct-injection: "true" on that secret. |
|
|
||
| # Added option to inject CA from Secret instead of Certificate. | ||
| # This allows running cainjector with --enable-certificates-data-source=false, which follows cert-manager best practices by disabling unused data sources. | ||
| injectCaFrom: "certificate" |
There was a problem hiding this comment.
I am not a big fan of this "enum", but your use case makes a lot of sense. Are you able to see a way to avoid this? Could it make sense to unconditionally use the cert-manager.io/inject-ca-from-secret annotation on the webhook?

Add support for injecting CA from Secret, allowing cainjector to run with --enable-certificates-data-source=false as recommended by best practices. https://cert-manager.io/docs/concepts/ca-injector/#controlling-which-data-sources-are-enabled