projectcapsule / capsule

Multi-tenancy and policy-based framework for Kubernetes.
https://projectcapsule.dev/
Apache License 2.0
1.61k stars 156 forks source link

Dropping exact and regex match for class resources #738

Open prometherion opened 1 year ago

prometherion commented 1 year ago

Starting from #436, we introduce the support for label selectors of cluster-scoped resources, such as IngressClass, StorageClass, RuntimeClass, and PriorityClass.

At the current state (v0.3.0), we're giving precedence to selectors over exact and regex matches, since Kubernetes is strongly opinionated on the concept of labels and selections.

With that said, for the next Tenant API release, I propose to drop the support of exact and regex matches: this change will put Capsule in a more Kubernetes-native standpoint, and simplify the filtering of resources from the proxy perspective.

@oliverbaehler @MaxFedotov @bsctl please, let's start the discussion.

MaxFedotov commented 1 year ago

Although it will be a completely backward-incompatible change, I really love this idea. It will make code faster (get rid of regex, yeeeah!) and simpler. The downside is that users had to update their tenant spec and correctly label their resources, but if it will be a next big major version i think it is ok

oliverbaehler commented 1 year ago

Agree with @MaxFedotov. We'll just have to create good documentation regarding "how to migrate from regex/exact matches". Just so endusers have an easy path for migration. Also part of my comment here: https://github.com/clastix/capsule/issues/737#issuecomment-1501095214. Which would required a complete migration anyway. Or mabye we could even do some converions?

prometherion commented 11 months ago

I would postpone this change for v0.6.0 since the upcoming one (v0.5.0) is already adding some fields.

We could take advantage of the new API version that will provide podOptions to remove these fields too.

Let's make this transition as smooth as possible.