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

Seldon Core Operator Restricted to Single Namespace #1139

Closed
axsaucedo opened this issue Nov 26, 2019 · 10 comments · Fixed by #1142
Closed

Seldon Core Operator Restricted to Single Namespace #1139

axsaucedo opened this issue Nov 26, 2019 · 10 comments · Fixed by #1142
Assignees
Milestone

Comments

@axsaucedo
Copy link
Contributor

This task encompasses the functionality to deploy the Seldon Core Operator restricted to a single namespace. Our operator is built using Kubebuilder which by default was using Cluster-wide roles, however since we upgraded to Kubebuilder 2.0 we are now able to use normal roles, which would enable us to have more granular restrictions. This is also something that has been requested previously.

Related issues include #670, #890

@axsaucedo
Copy link
Contributor Author

@phsiao @lennon310 it would be great to hear your thoughts, especially as @cliveseldon mentioned that you currnetly have a walkaround that allows you to restrict Seldon Core to a specific set of namespaces

@axsaucedo
Copy link
Contributor Author

For context, this was discussed on the wider context around rolling updates, and how we will be aiming to support versions of Seldon. For more information on some notes, you can check out #890 (comment)

@ukclivecox ukclivecox self-assigned this Nov 26, 2019
@ukclivecox ukclivecox added this to the 1.0 milestone Nov 26, 2019
@adriangonz
Copy link
Contributor

@cliveseldon do you have any ideas on what would be the best way to differentiate between namespace vs cluster installations? Is this something that can be handled through helm?

@ukclivecox
Copy link
Contributor

So far I have just started the Kustomize change so it will be a different overlay namespaced
For helm it will be a setting in the values file.

@phsiao
Copy link

phsiao commented Nov 26, 2019

Some initial thought.

There are a few components that we need to stage changes in order for a meaningful test, CRD, webhook, and the operator. The operator is probably the easiest to contain, while the other two may need some thought.

An approach that I have seen that works is some form of "instance id" annotation, where if an instance of CRD is annotated with that, only the matching operator would process it. I think it might be possible to take the same approach for webhook.

@ukclivecox
Copy link
Contributor

Thanks @phsiao
I think webhooks can be scoped to namespaces.
For CRDs I think they are cluster wide so only 1 can be there but it can reference various versions of the CRD and activate conversion. So not sure what you are refering to by "instance-id". Can you point to some docs for this?

@phsiao
Copy link

phsiao commented Nov 26, 2019

Ambassador uses instance-id annotation for example, emissary-ingress/emissary#308. Other operators we worked on has similar concept so we can create virtual partitions of the objects in the same cluster.

For our use cases, we would expect there is a cluster-wide operator and webhook to continue to support existing objects, while testing new operator/webhook by having this virtual partition in some ways. Scoped to a namespace is good, but need also a way to isolate the cluster-wide operator and webhook to process the namespaced objects.

@adriangonz
Copy link
Contributor

That's a really good suggestion @phsiao! I think it would be good to have all these really:

  • Support for namespaced (as well as cluster-wide) operators. Webhooks will also need to be scoped to the relevant namespace.
  • Support for annotations, similar to how Ambassador uses them. I'm still not sure how these work with webhooks though. Ambassador's operator simply ignores resources with an annotated version different than the operator's. However, webhooks work at the Kubernetes level. I haven't been able to find any example of a configured webhook at the Ambassador project.
  • Support for CRD conversion, so that we can have different versions stored at the same time. I'm not sure how kubebuilder handles this at the moment, but I think that the webhook for conversion should also be installed cluster-wide alongside the CRD.

Except the first one, the other two would be out of the scope of this issue.

@ukclivecox
Copy link
Contributor

That's a really good suggestion @phsiao! I think it would be good to have all these really:

* Support for namespaced (as well as cluster-wide) operators. Webhooks will also need to be scoped to the relevant namespace.

* Support for annotations, similar to how Ambassador uses them. I'm still not sure how these work with webhooks though. Ambassador's operator simply ignores resources with an annotated version different than the operator's. However, webhooks work at the Kubernetes level. I haven't been able to find any example of a configured webhook at the Ambassador project.

* Support for CRD conversion, so that we can have different versions stored at the same time. I'm not sure how `kubebuilder` handles this at the moment, but I think that the webhook for conversion should also be installed cluster-wide alongside the CRD.

Except the first one, the other two would be out of the scope of this issue.

I'm looking at solving the first two actually in this issue as they are related. CRD conversion is I agree a separate issue.

@phsiao
Copy link

phsiao commented Nov 27, 2019

IIRC, we use webhook only on seldon deployment objects, so the annotation will also be there. We just need to be able to deploy multiple mutating webhook configuration, where each knows which virtual partition of objects it needs to work on, and let the others handle the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants