diff --git a/controllers/cmd/start.go b/controllers/cmd/start.go index 9f6a68edab..fc699dfc73 100644 --- a/controllers/cmd/start.go +++ b/controllers/cmd/start.go @@ -46,6 +46,8 @@ func Start(namespaced bool, managedNamespace string) { opts := ctrl.Options{ MetricsBindAddress: fmt.Sprintf(":%d", common.ControllerMetricsPort), HealthProbeBindAddress: ":8081", + LeaderElection: true, + LeaderElectionID: "argo-events-controller", } if namespaced { opts.Namespace = managedNamespace diff --git a/manifests/cluster-install/rbac/argo-events-cluster-role.yaml b/manifests/cluster-install/rbac/argo-events-cluster-role.yaml index 0f75111f66..e8f5edca2c 100644 --- a/manifests/cluster-install/rbac/argo-events-cluster-role.yaml +++ b/manifests/cluster-install/rbac/argo-events-cluster-role.yaml @@ -3,6 +3,25 @@ kind: ClusterRole metadata: name: argo-events-role rules: + - apiGroups: + - "" + resources: + - "events" + verbs: + - "create" + - "patch" + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - argoproj.io verbs: diff --git a/manifests/install.yaml b/manifests/install.yaml index dbb737de4e..f38882676f 100644 --- a/manifests/install.yaml +++ b/manifests/install.yaml @@ -211,6 +211,25 @@ kind: ClusterRole metadata: name: argo-events-role rules: +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - argoproj.io resources: diff --git a/manifests/namespace-install.yaml b/manifests/namespace-install.yaml index d34fdbacd4..4b6c461bbb 100644 --- a/manifests/namespace-install.yaml +++ b/manifests/namespace-install.yaml @@ -130,6 +130,25 @@ metadata: name: argo-events-role namespace: argo-events rules: +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - argoproj.io resources: diff --git a/manifests/namespace-install/rbac/argo-events-role.yaml b/manifests/namespace-install/rbac/argo-events-role.yaml index aa79885438..a5b35931dd 100644 --- a/manifests/namespace-install/rbac/argo-events-role.yaml +++ b/manifests/namespace-install/rbac/argo-events-role.yaml @@ -3,6 +3,25 @@ kind: Role metadata: name: argo-events-role rules: + - apiGroups: + - "" + resources: + - "events" + verbs: + - "create" + - "patch" + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete - apiGroups: - argoproj.io verbs: