github.com/argoproj/argo-events@v1.9.1/docs/sensors/ha.md (about) 1 # Sensor High Availability 2 3 Sensor controller creates a k8s deployment (replica number defaults to 1) for 4 each Sensor object. HA with `Active-Passive` strategy can be achieved by setting 5 `spec.replicas` to a number greater than 1, which means only one Pod serves 6 traffic and the rest ones stand by. One of standby Pods will be automatically 7 elected to be active if the old one is gone. 8 9 **Please DO NOT manually scale up the replicas, that might cause unexpected 10 behaviors!** 11 12 ## Kubernetes Leader Election 13 14 By default, Argo Events will use NATS for the HA leader election except when 15 using a Kafka Eventbus, in which case a leader election is not required as a 16 Sensor that uses a Kafka EventBus is capable of horizontally scaling. If using 17 a different EventBus you can opt-in to a Kubernetes native leader election by 18 specifying the following annotation. 19 ```yaml 20 annotations: 21 events.argoproj.io/leader-election: k8s 22 ``` 23 24 To use Kubernetes leader election the following RBAC rules need to be associated 25 with the Sensor ServiceAccount. 26 ```yaml 27 apiVersion: rbac.authorization.k8s.io/v1 28 kind: Role 29 metadata: 30 name: argo-events-leaderelection-role 31 rules: 32 - apiGroups: ["coordination.k8s.io"] 33 resources: ["leases"] 34 verbs: ["get", "create", "update"] 35 ``` 36 37 ## More 38 39 Click [here](../dr_ha_recommendations.md) to learn more information about Argo 40 Events DR/HA recommendations.