-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Webhook proposal #1455
Webhook proposal #1455
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,30 @@ | ||||||||||
## Webhook Support | ||||||||||
|
||||||||||
Implementation Owner: theishshah | ||||||||||
Status: Draft | ||||||||||
|
||||||||||
[Background](#Background) | ||||||||||
[Goals](#Goals) | ||||||||||
[Design overview](#Design_overview) | ||||||||||
[User facing usage](#User_facing_usage) | ||||||||||
[Observations and open questions](#Observations_and_open_questions) | ||||||||||
|
||||||||||
### Background | ||||||||||
|
||||||||||
The upcoming stable version of controller runtime has support for running a webhook server and having webhooks to mutate or validate pods. The mutation webhook can change various attributes of a pod, and the validation webhook can read pod attributes and allow/deny a pod to run based on this information. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we specify the version here, e.g.:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
### Goals | ||||||||||
|
||||||||||
The goal of this proposal is to add the abilty for users to quickly add a webhook server and only implement the validation/mutation logic for their webhooks. | ||||||||||
|
||||||||||
### Design overview | ||||||||||
|
||||||||||
All of the necesary files and changes for the generated operator occur in the cmd/manager/ directory. The code to create and register the server is in the main.go file and can be completely generated with no additional input needed from the user. In addition the osdk will provide 2 files, 1 each for validation and mutation webhooks. These will have a template Handle function in which the user can define the desired behavior for their pod validation/mutation logic. | ||||||||||
|
||||||||||
### User facing usage (if needed) | ||||||||||
|
||||||||||
My suggested method for interacting with this feature is to have a command in the osdk which can be run after generating the base operator. The new command `generate webhook` will write the files cmd/manager/main.go, cmd/manager/mutationwebhook.go, and cmd/manager/validationwebhook.go | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @theishshah Have you had a chance to think about some of the improvements we discussed offline? If I recall, I think we talked about:
Also, would you mind adding more detail to this proposal doc?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with @joelanford on the last two points ^ |
||||||||||
|
||||||||||
### Observations and open questions | ||||||||||
|
||||||||||
[Here](https://github.com/operator-framework/operator-sdk-samples/pull/63) is an example of the planned implementation on the alpha version of controller runtime. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I like having a working example, can you include the code parts roughly in this proposal? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change it to use the template? WDYT?