Skip to content
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

Allow templating of labels/annotations on target configmaps/secrets #340

Open
qcattez opened this issue Apr 23, 2024 · 6 comments
Open

Allow templating of labels/annotations on target configmaps/secrets #340

qcattez opened this issue Apr 23, 2024 · 6 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Comments

@qcattez
Copy link

qcattez commented Apr 23, 2024

When creating ValidatingWebhookConfiguration or MutatingWebhookConfiguration, we can specify the CA bundle to use in the ClientConfig : https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#webhookclientconfig-v1-admissionregistration-k8s-io

However, those ressources doesn't allow to specify the CA bundle from a Secret or Configmap (only inline).
cert-manager tackles this problem by injecting the CA bundle on resources annotated with cert-manager.io/inject-ca-from: <namespace>/<certificate>.

So in order to provide the same functionality as cert-manager, it would be nice to introduce a trust-manager-ca-injector that would be responsible to inject the CA bundle on resources annotated with trust.cert-manager.io/inject-ca-from: <namespace>/<bundle>.

@qcattez
Copy link
Author

qcattez commented Apr 23, 2024

When looking into the cert-manager-ca-injector documentation, I found this :
https://cert-manager.io/docs/concepts/ca-injector/#injecting-ca-data-from-a-secret-resource

Thus allowing us to inject the CA bundle from a secret that would have been created by trust-manager.

Sorry for the inconvenience 🙏

@qcattez qcattez closed this as completed Apr 23, 2024
@qcattez
Copy link
Author

qcattez commented Apr 23, 2024

In the end, the use of the annotation cert-manager.io/inject-ca-from-secret allows us to specify a secret to define the CA for admissions webhooks.

But the only thing missing for this feature to be achievable is to be able to add custom annotations on the secret created by the Bundle. For now, only the key can be specified : https://cert-manager.io/docs/trust/trust-manager/api-reference/#bundlespectargetsecret

It would be nice to be able to add the cert-manager.io/allow-direct-injection: "true" annotation on the created secret.

@qcattez qcattez reopened this Apr 23, 2024
@erikgb
Copy link
Contributor

erikgb commented Apr 23, 2024

It could make sense to add a feature similar to cert-manager secretTemplate. That should make the feature address more use cases, and not just this one specifically. It should also cover target configmaps if implemented.

@cert-manager-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
/lifecycle stale

@cert-manager-prow cert-manager-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 6, 2024
@erikgb erikgb changed the title Allow to specify admission webhooks CA from Bundle Allow templating of labels/annotations on target configmaps/secrets Nov 6, 2024
@erikgb
Copy link
Contributor

erikgb commented Nov 6, 2024

/remove-lifecycle stale
/help

@cert-manager-prow
Copy link
Contributor

@erikgb:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/remove-lifecycle stale
/help

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.

@cert-manager-prow cert-manager-prow bot added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Projects
None yet
Development

No branches or pull requests

3 participants