Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Add support for leader election #966

Merged
merged 10 commits into from
Feb 27, 2020

Conversation

pmorie
Copy link
Member

@pmorie pmorie commented Feb 25, 2020

Fixes knative/pkg#1007

Proposed Changes

Add (inactive) leader election configurations for:

  • Kafka channel
  • Kafka source
  • Prometheus source
  • Github source
  • Couchdb source
  • AWS SQS

Release Note

Add support for leader election to:

- Kafka channel
- Kafka source
- Prometheus source
- Github source
- Couchdb source
- AWS SQS

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 25, 2020
@knative-prow-robot knative-prow-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 25, 2020
@pmorie pmorie changed the title DO NOT MERGE: update pkg dep to pmorie fork Add support for leader election Feb 25, 2020
@n3wscott
Copy link
Contributor

/approve
/lgtm
/hold
hold for found source = "github.com/pmorie/pkg" for knative/pkg in toml.

@knative-prow-robot knative-prow-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Feb 26, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n3wscott, pmorie

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 26, 2020
@matzew
Copy link
Member

matzew commented Feb 26, 2020

Is this already in the pkg 0.13 ?

@matzew
Copy link
Member

matzew commented Feb 26, 2020

Is this already in the pkg 0.13 ?

it is: https://github.com/knative/pkg/commits/release-0.13

@matzew
Copy link
Member

matzew commented Feb 26, 2020

and since we now have that already used in here:

https://github.com/knative/eventing-contrib/pull/968/files

I think this is not needed?

@pmorie
Copy link
Member Author

pmorie commented Feb 26, 2020

it is: https://github.com/knative/pkg/commits/release-0.13

Nope, that's just the commit that differentiates the main for the normal controllers and webhooks.

@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 26, 2020
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 27, 2020
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

Do you want to update the PR description?

Proposed Changes

  • This affects only the kafka channel dispatcher, since it uses sharedmain.MainWithContext

resources:
- leases
verbs:
- get
Copy link
Member

Choose a reason for hiding this comment

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

Why does this use an explicit list, but the couchdb YAML and others use a reference?

Copy link
Member Author

Choose a reason for hiding this comment

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

I followed the pattern in use in whatever file I was modifying, which follow varying conventions.

# leader election is enabled. Valid values are:
#
# - couchdb-controller
enabledComponents: "couchdb-controller"
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to rename the awssqs component awssqs-controller, rather than controller?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably sensible

- "coordination.k8s.io"
resources:
- leases
verbs:
Copy link
Member

Choose a reason for hiding this comment

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

Why is this a smaller list of verbs than elsewhere (missing delete)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Inadvertent, I was tired.

#
# - kafkachannel_dispatcher
# - kafkachannel_controller
enabledComponents: "kafkachannel_dispatcher,kafkachannel_controller"
Copy link
Member

Choose a reason for hiding this comment

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

Should these have hyphens, to match the changes in the main.go files?

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, I thought I got them all. thanks

# leader election is enabled. Valid values are:
#
# - controller
enabledComponents: "controller"
Copy link
Member

Choose a reason for hiding this comment

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

should we here, and perhaps in https://github.com/knative/eventing-contrib/blob/master/awssqs/cmd/controller/main.go#L29

make this more like awssqs-controller ?

@@ -26,7 +26,7 @@ import (
controller "knative.dev/eventing-contrib/kafka/channel/pkg/reconciler/dispatcher"
)

const component = "kafkachannel_dispatcher"
const component = "kafkachannel-dispatcher"
Copy link
Member

Choose a reason for hiding this comment

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

there is references to this _ version in kafka/docs/metrics.md -> mind updateing ?

Copy link
Member Author

Choose a reason for hiding this comment

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

ahhh, thank you

@n3wscott
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2020
@n3wscott
Copy link
Contributor

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 27, 2020
@knative-prow-robot knative-prow-robot merged commit 9bdda04 into knative:master Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Track] Active/passive HA
7 participants