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

feat(sensor): disable leader election for jetstream eventbus #3240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/sensors/ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ behaviors!**
## Kubernetes Leader Election

By default, Argo Events will use NATS for the HA leader election except when
using a Kafka Eventbus, in which case a leader election is not required as a
Sensor that uses a Kafka EventBus is capable of horizontally scaling. If using
using a Kafka or JetStream Eventbus, in which case a leader election is not required as a
Sensor that uses a Kafka/JetStream EventBus is capable of horizontally scaling. If using
a different EventBus you can opt-in to a Kubernetes native leader election by
specifying the following annotation.
```yaml
Expand Down
4 changes: 2 additions & 2 deletions pkg/sensors/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func (sensorCtx *SensorContext) Start(ctx context.Context) error {
replicas := int(sensorCtx.sensor.Spec.GetReplicas())
leasename := fmt.Sprintf("sensor-%s", sensorCtx.sensor.Name)

// sensor for kafka eventbus can be scaled horizontally,
// sensor for kafka/jetstream eventbus can be scaled horizontally,
// therefore does not require an elector
if sensorCtx.eventBusConfig.Kafka != nil {
if sensorCtx.eventBusConfig.Kafka != nil || sensorCtx.eventBusConfig.JetStream != nil {
return sensorCtx.listenEvents(ctx)
}

Expand Down
Loading