-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Validating Admission Webhook #13503
Comments
I would like this to happen, especially Admission Webhooks. There are certain classes of error that Admission Policies couldn't be crafted to help with such as invalid fields in yaml dictionaries which are a common class of error - either just misspellings or using a field which isn't valid in this location. |
That one could be detected actually as CEL Macros include More dynamic things though, like detecting certain kinds of invalid |
Summary
We currently have various scenarios where an invalid
Workflow
will be allowed in the cluster, causing bugs to be found much later instead of upfront. The CLI and API handle (some) validation, but direct to k8s will miss some of this.Use Cases
The lack of any validation when submitting directly to k8s can cause some unexpected scenarios like #6781 , #12693, #10630. In all those issues and some others, I've mentioned the concept of a Validating Admission Webhook to prevent these scenarios and give clearer error messages: #12693 (comment), #10630 (comment), #6781 (comment)
Note that even if we do have a validating admission webhook, it may be optional, it may not handle resources that were created before it existed, and it may not be able to validate all scenarios, so the Controller and Informers would still have to be "tolerant" (the word the codebase uses) of invalid resources. This is primarily a feature to improve UX
Implementation Details
There are 2 primary ways of doing Validating Admission in k8s these days:
Admission Webhooks
argo-workflows.validatingAdmissionWebhook.enabled: true
or similar.cert-manager
etc.cert-manager
was unintentionally required in the manifests for external-facing TLS certs (not internal ones).Admission Policies (stable as of k8s 1.30)
status
may still display it as invalid, but those are post-hoc signals that a user has to notice)I would probably suggest an optional of version of 1 for consistency, and then 2.b. as something deployed with all manifests as a baseline. We could even start making simple policies already and add them to the manifests and then gradually build them up -- #6781 is a very simple length check, for instance
Message from the maintainers:
Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.
The text was updated successfully, but these errors were encountered: