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

feature: support instance-id label or similar on kargo resources #2003

Open
krancour opened this issue May 13, 2024 · 2 comments
Open

feature: support instance-id label or similar on kargo resources #2003

krancour opened this issue May 13, 2024 · 2 comments

Comments

@krancour
Copy link
Member

From #1989

Adding the ability for control plane components to filter lists/watches on Project resources based on an "instance-id" filter (or something of the sort), would permit the multiple Kargo control planes to co-exist in a single cluster -- which is not otherwise possible due to Projects themselves being cluster-scoped.

Note: Kargo controllers already support something similiar to this (sharding) -- working with a subset of the resources from a Kargo control plane -- but with the possibility of multiple Kargo control planes situated on a single cluster, Kargo controllers will have to further narrow resources of interest to those with a specific "instance-id," which means we also need to ensure that instance-ids are correctly propagated to all resources (e.g. Freight or Promotions) that are created by any given control plane or controller. I would also propose that as with shards, instance-ids might reasonably be a "first-class" field in relevant specs and that this can be seamlessly synced with the appropriate label by a webhook. This creates a better UX while still allowing clients to list/watch efficiently using label selectors.

I am tentatively setting this as low-priority as we've not yet heard from many wishing to host multiple Kargo control planes in a single cluster. That can change if/when we hear of more demand for this. In the meantime, a contribution from the community may be the fastest path to achieving this. Please note, however, that this is not at all a trivial change.

@hiddeco
Copy link
Contributor

hiddeco commented May 13, 2024

Think the size of this could actually be pretty small as controller-runtime allows for configuration of the cache using default label selectors, which means it would be roughly a 100LOC change.

@krancour
Copy link
Member Author

krancour commented May 13, 2024

@hiddeco but there's also the chart changes to add some instance ID to an env var, changes on the Go side of each component to read and use that, and also the changes to make sure appropriate labels are propagated to new Freight and Promotions. There's also CRD changes and webhook changes if we want to sync new "first-class" instance-id fields in various resources types (probably Project, Stage, and Warehouse) with a label...

All I mean to say is, even if not more than 100LOC, it touches a lot of things. Few keystrokes, possibly, but disproportionately high 🧠 effort.

I'll knock it down to medium.

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

2 participants