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

Enable high availability through Knative leader election support #242

Merged
merged 2 commits into from
Sep 28, 2022

Conversation

alan-ghelardi
Copy link
Contributor

@alan-ghelardi alan-ghelardi commented Sep 27, 2022

What

  • Enable high availability by making Watcher controllers leader aware. This allows the two forms of leader election (standard and statefulset-based) provided by Knative to be easily used in the Watcher.
  • Add the threadiness flag to the Watcher binary. It allows users to tweak the number of workers allocated to process the controller's worker queue.
  • Add the tekton-results-watcher Service. This is mostly a convenience to users who want to enable the statefulset-based leader election mechanism.
  • Add ConfigMaps to customize logging, leader election and observability. The
    config-leader-election ConfigMap allows users to tweak the leader election
    mechanism. The other two ones make Results more homogeneous with Tekton
    Pipeline project.

Why

This pull request resolves #241, which
contains more details on why this feature is relevant. Essentially, it allows
users to tweak the Watcher controller to deal with higher loads more easily.

Additional information

I tested those changes in a local Kind cluster and they're working as
expected. When the standard leader election mode is enabled, one replica
reconciles PipelineRuns and TaskRuns while the other one does nothing. When the
statefulset mode is enabled with three replicas for instance, all instances
reconcile different keys simultaneously.

@tekton-robot
Copy link

Hi @alan-ghelardi. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 27, 2022
@dibyom
Copy link
Member

dibyom commented Sep 27, 2022

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 27, 2022
Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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


// Lister is a generic signature of Lister.List functions, by allowing us to
// support various listers in the NewLeaderAwareFuncs function below.
type Lister[O metav1.Object] func(labels.Selector) ([]O, error)
Copy link
Member

Choose a reason for hiding this comment

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

neat!

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 27, 2022
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 28, 2022
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot merged commit ad64f49 into tektoncd:main Sep 28, 2022
Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

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

/kind feature
We need this label for release as discussed in the last WG call.

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable high availability in the Watcher
5 participants