Skip to content

Commit

Permalink
feat: Controller Leader Election (#1883)
Browse files Browse the repository at this point in the history
* Issue 1565: Controller Leader Election

Signed-off-by: David Collom <[email protected]>

* Fix up RBAC

Signed-off-by: David Collom <[email protected]>

* Adding coordination/leases to install/namespace-install

Signed-off-by: David Collom <[email protected]>

* Fix up rbac

Signed-off-by: David Collom <[email protected]>

* Adding additional RBAC for Events

Signed-off-by: David Collom <[email protected]>
  • Loading branch information
davidcollom authored Apr 22, 2022
1 parent 66cb7c4 commit 8a97852
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions manifests/cluster-install/rbac/argo-events-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions manifests/namespace-install/rbac/argo-events-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8a97852

Please sign in to comment.