Skip to content

Add reconciler sharding capability based on label selector#1059

Merged
hiddeco merged 4 commits intomainfrom
watch-label-selector
Mar 29, 2023
Merged

Add reconciler sharding capability based on label selector#1059
hiddeco merged 4 commits intomainfrom
watch-label-selector

Conversation

@hiddeco
Copy link
Copy Markdown
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
Comment thread main.go Outdated
@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 force-pushed the watch-label-selector branch from b978314 to 52d7bab Compare March 29, 2023 11:04
@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
Copy Markdown
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

hiddeco added 3 commits March 29, 2023 14:02
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>
@hiddeco hiddeco force-pushed the watch-label-selector branch from 52d7bab to 2701c61 Compare March 29, 2023 12:02
Copy link
Copy Markdown
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