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

Add reconciler sharding capability based on label selector #1059

Merged
merged 4 commits into from
Mar 29, 2023

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Mar 28, 2023

Implementation of the work done in fluxcd/pkg#525

Part of fluxcd/flux2#3731

@hiddeco hiddeco added the enhancement New feature or request label Mar 28, 2023
@hiddeco hiddeco force-pushed the watch-label-selector branch 3 times, most recently from dd063da to cf93f78 Compare March 28, 2023 20:29
main.go Outdated Show resolved Hide resolved
@hiddeco hiddeco force-pushed the watch-label-selector branch 3 times, most recently from c38022e to b978314 Compare March 29, 2023 09:52
With this enhancement, the controller can be configured with
`--watch-label-selector`, after which only objects with this label will
be reconciled by the controller.

This allows for horizontal scaling of the source-controller, where each
controller can be deployed multiple times with a unique label selector
which is used as the sharding key.

Note that this also requires configuration of the `--storage-adv-addr`
to a unique address (in combination with a proper Service definition).
This to ensure the Artifacts handled by the sharding controller point
to a unique endpoint.

In addition, Source object kinds which have a dependency on another
kind (i.e. a HelmChart on a HelmRepository) need to have the same
labels applied to work as expected.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
@hiddeco hiddeco marked this pull request as ready for review March 29, 2023 11:04
@stefanprodan stefanprodan added this to the Bootstrap GA milestone Mar 29, 2023
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @hiddeco

Yay to readability.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This was an artifact of the desire to run `make run` without any custom
configuration, rather than it being a feature of the controller. The
setup of this has now been moved to the `Makefile` itself, including the
required configuration of the `--storage-adv-addr`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hiddeco hiddeco merged commit 7a271f1 into main Mar 29, 2023
@hiddeco hiddeco deleted the watch-label-selector branch March 29, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants