Skip to content

Commit 92c8959

Browse files
committed
Revert "Revert "Add RBAC for lease objects""
This reverts commit 4bfa0db.
1 parent 2bea18e commit 92c8959

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

pkg/generate/ack/controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ var (
3737
"config/rbac/role-reader.yaml.tpl",
3838
"config/rbac/role-writer.yaml.tpl",
3939
"config/rbac/service-account.yaml.tpl",
40+
"config/rbac/leader_election_role_binding.yaml.tpl",
41+
"config/rbac/leader_election_role.yaml.tpl",
4042
"config/rbac/kustomization.yaml.tpl",
4143
"config/crd/kustomization.yaml.tpl",
4244
"config/overlays/namespaced/kustomization.yaml.tpl",

templates/config/rbac/kustomization.yaml.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ resources:
44
- role-reader.yaml
55
- role-writer.yaml
66
- service-account.yaml
7+
- leader_election_role.yaml
8+
- leader_election_role_binding.yaml
79

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: {{.ServicePackageName}}-leader-election-role
6+
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- configmaps
11+
verbs:
12+
- get
13+
- list
14+
- watch
15+
- create
16+
- update
17+
- patch
18+
- delete
19+
- apiGroups:
20+
- coordination.k8s.io
21+
resources:
22+
- leases
23+
verbs:
24+
- get
25+
- list
26+
- watch
27+
- create
28+
- update
29+
- patch
30+
- delete
31+
- apiGroups:
32+
- ""
33+
resources:
34+
- events
35+
verbs:
36+
- create
37+
- patch
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: RoleBinding
4+
metadata:
5+
name: {{.ServicePackageName}}-leader-election-rolebinding
6+
roleRef:
7+
apiGroup: rbac.authorization.k8s.io
8+
kind: Role
9+
name: {{.ServicePackageName}}-leader-election-role
10+
subjects:
11+
- kind: ServiceAccount
12+
name: {{.ServiceAccountName}}
13+
namespace: ack-system

0 commit comments

Comments
 (0)