-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
[feature]: Specify failurepolicy when MutatingWebhookConfiguration is created #532
Comments
I don't think having further configuration would be bad, though for your specific situation, I would not necessarily allow items to fall through the webhook when pods the operator gets redeployed (unless that's a non-issue for you). What you can do is have the webhook configured to exclude mutating anything in a select few namespaces (kube-system and whatever namespace you would be deploying your operator into), by applying a label to them (such as "IgnoreMutate") and then filtering on that: apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
webhooks:
- name: my-webhook.example.com
namespaceSelector:
matchExpressions:
- key: IgnoreMutate
operator: NotExists
rules:
- operations: ["CREATE"]
apiGroups: ["*"]
apiVersions: ["*"]
resources: ["pod"]
scope: "Namespaced" |
Thanks for the suggestion, I would still need a way to customize the mutating webhook configuration when the init container runs. I can create a PR with this feature, along with the bug I filed, and a fix for #525. I had to fix both those bugs and add this feature in a locally modified version in order to continue my project. Would you be open to accepting that PR? |
Hey @EdwardCooke |
Awesome. I'll try and get a PR up in the next couple of days. I was thinking of a new interface that could optionally be implemented that would be called. Should be pretty easy to follow. |
A pull request is created. It also addresses #525, something that was also causing me pains. I implemented that as an opt-in feature since it would delete the existing webhooks and recreate them on startup to guarantee an expected state. |
Is your feature request related to a problem? Please describe.
I'm trying to create a mutator on a pod, which works only while my operator is running. When the operator dies, for example, restarting the deployment, the pods can't be created because the
failurePolicy
is set toFail
, the default. When the pod starts up after changing it manually it gets reset to Fail.Describe the solution you would like
Have a method called on the webhook that will allow us to configure the webhook and other objects that get installed in the cluster.
Additional Context
No response
The text was updated successfully, but these errors were encountered: