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

Create common CRD validate and mutating webhook for all operator #1016

Closed
wackxu opened this issue May 27, 2019 · 32 comments
Closed

Create common CRD validate and mutating webhook for all operator #1016

wackxu opened this issue May 27, 2019 · 32 comments

Comments

@wackxu
Copy link
Contributor

wackxu commented May 27, 2019

If the spec of tfjob is invalid, we should reject the request when creating and also set default when create tfjob. we can use the k8s webhook to do this. And also we can replace the unstructured informer code.

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label improvement/enhancement to this issue, with a confidence of 0.86. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@wackxu
Copy link
Contributor Author

wackxu commented Jun 10, 2019

@gaocegege
Copy link
Member

It is a good idea. I think we need it.

@gaocegege
Copy link
Member

Personally, I think we should use validation webhook instead of the unstructured informer in the code.

@wackxu
Copy link
Contributor Author

wackxu commented Jun 11, 2019

@gaocegege Yes. agree with that. I think we can use one webhook server for all the operator to do validate or set default value, WDYT?

@gaocegege
Copy link
Member

Personally, SGTM.

WDYT @johnugeorge @richardsliu

@johnugeorge
Copy link
Member

LGTM. However, we should not take this up in this release as we are late.

@gaocegege
Copy link
Member

Yeah, I think so

@wackxu
Copy link
Contributor Author

wackxu commented Jun 13, 2019

@gaocegege @johnugeorge @richardsliu So we need create a new repository for the webhook, then I can start the webhook work.

@gaocegege
Copy link
Member

We need a detailed proposal to persuade the community to open a new repo.

@johnugeorge
Copy link
Member

Just wondering why do we need a separate repo for webhook?

@gaocegege
Copy link
Member

I think we need a proposal first, then we can discuss it and decide if we need a repo for it.

@wackxu Are you interested in the proposal? I can co-work with you if you are busy.

@wackxu
Copy link
Contributor Author

wackxu commented Jun 13, 2019

Just wondering why do we need a separate repo for webhook?

We may want to add validate webhook for all operators and we have about six operators, so I think use one operator for all operators and we can use some switch to let user to choose which webhook to use.

@wackxu
Copy link
Contributor Author

wackxu commented Jun 13, 2019

I think we need a proposal first, then we can discuss it and decide if we need a repo for it.

@wackxu Are you interested in the proposal? I can co-work with you if you are busy.

@gaocegege I am busy with some internal work recently. You can start write the proposal and I can help review and implement the code.

@gaocegege
Copy link
Member

@wackxu Maybe we could have a meeting later to make sure that we are on the same page.

@wackxu
Copy link
Contributor Author

wackxu commented Jun 13, 2019

@gaocegege yes, we can talk more details in the slack.

@johnugeorge
Copy link
Member

@wackxu Are you planning to take this up?

@johnugeorge
Copy link
Member

Related: #1026

@wackxu
Copy link
Contributor Author

wackxu commented Aug 31, 2019

@johnugeorge Sorry for the delay, Yes I will but we need a new repo for it first.

@richardsliu
Copy link
Contributor

@johnugeorge Should we take this on for 0.7?

@johnugeorge
Copy link
Member

@wackxu Why do you need a separate repo for it?

@wackxu
Copy link
Contributor Author

wackxu commented Sep 9, 2019

@johnugeorge I think we should add webhook for all operators. If we do not put them in a single repo, then we should add webhook for each operator separately. It is not convenient for user that use multiple operator to deploy and maintain.

@wackxu
Copy link
Contributor Author

wackxu commented Sep 9, 2019

We can use switch to control which webhook is turned on. If user only use one operator such as tf-operator, then he can only turn on the tf webhook switch. It is convenient for user to manage these operator webhook.

@gaocegege
Copy link
Member

@wackxu @johnugeorge Is there any update? I think it is an important feature.

@johnugeorge
Copy link
Member

@gaocegege This is not yet taken up

@sarahmaddox
Copy link

/area gsoc

@gaocegege
Copy link
Member

gaocegege commented Apr 2, 2020

/cc @carmark @johnugeorge @ChanYiLin

I think we can reuse this repo to keep the webhook if needed. https://github.com/kubeflow/crd-validation

@jlewi
Copy link
Contributor

jlewi commented Apr 25, 2020

Do we still need to create our validation webhook? It looks like Kubernetes custom resources now allow schemas to be specified using OpenAPI in which case valdiation will happen automatically.
https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#specifying-a-structural-schema

Related: kubeflow/katib#1170

@lalithvaka
Copy link

Do we still need to create our validation webhook? It looks like Kubernetes custom resources now allow schemas to be specified using OpenAPI in which case valdiation will happen automatically.
https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#specifying-a-structural-schema

Related: kubeflow/katib#1170

This seems like a good idea. Only thing to watch for is this feature is supported only K8S Cluster version 1.16 and above!

@stale
Copy link

stale bot commented Jul 26, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the labels:

Label Probability
feature 0.92

Please mark this comment with 👍 or 👎 to give our bot feedback!
Links: app homepage, dashboard and code for this bot.

@jlewi jlewi removed the feature label Jul 27, 2020
@stale stale bot removed the lifecycle/stale label Jul 27, 2020
@stale
Copy link

stale bot commented Oct 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot closed this as completed Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants