-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[extension/leader elector] Initial implementation for the extension leader elector #37144
base: main
Are you sure you want to change the base?
[extension/leader elector] Initial implementation for the extension leader elector #37144
Conversation
One question, does this extension work for all receivers? Does the receiver need to be modified? |
Hi @JaredTan95 the receiver needs to be modified to be able to support this extension. |
receivers: [my_awesome_receiver] | ||
``` | ||
### Leader Election Configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to give a rolebingding example about the lease
that serviceaccount needs to bind with ClusterRoleBinding
ClusterRole
.
See the example in Kubernetes Events Receiver
: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/k8seventsreceiver#rbac
Please secure a sponsor for this component. |
Description
This extension could be used to run multiple receivers in HA mode. The receiver which has successfully acquired the lease becomes active and thus becomes leader.
The extension uses k8s.io/client-go/tools/leaderelection to perform leader election. The component that owns the lease becomes the leader and runs the function defined in
onStartedLeading
. If the leader loses the lease, it runs the function defined inonStoppedLeading
, stops its operation, and waits to acquire the lease again.The config would like this:
Link to tracking issue
Fixes
#34460
Testing
Unit tests have been implemented.
Documentation
Readme doc has been added.