Skip to content

Does Kubebuilder Annotation support NamespaceSelector? #2461

Closed Answered by camilamacedo86
moluzhui asked this question in Support
Discussion options

You must be logged in to vote

KubeBuilder annotations (markers) don't provide direct support for the namespaceSelector configuration in webhooks. You would need to add the namespaceSelector field manually to the generated webhook configuration after using the CLI.

While KubeBuilder can scaffold a large portion of your webhook configuration using annotations like:

// +kubebuilder:webhook:path=/mutate-pod,mutating=true,failurePolicy=fail,groups="",resources=pods,verbs=create,versions=v1,name=mutate-config.admission.yourdomain.com

Also, you might be interested in the the option available in the kustomize.yml to create labels
See:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by camilamacedo86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants