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

[extension/leader elector] Initial implementation for the extension leader elector - basic structure #37266

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rakesh-garimella
Copy link

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 in onStoppedLeading, stops its operation, and waits to acquire the lease again.

The config would like this:

receivers:
  my_awesome_reciever:
    leader_elector: leader_elector
exporters:
  debug:
    verbosity: detailed
extensions:
  leader_elector:
    auth_type: kubeConfig
    lease_name: foo
    lease_namespace: default

service:
  extensions: [leader_elector]
  pipelines:
    metrics:
      receivers: [my_awesome_receiver]
      exporters: [debug]
  telemetry:
    logs:
      level: debug

Link to tracking issue

Fixes
#34460

Testing

unit tests have been added

Documentation

README file has been added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants