Skip to content

Commit f51c092

Browse files
committed
add RBAC setup and fix review nits
1 parent d8b79ce commit f51c092

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

cluster/manifests/role-sync-controller/cronjob.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: batch/v1
33
kind: CronJob
44
metadata:
55
name: role-sync-controller
6+
namespace: kube-system
67
labels:
78
application: kubernetes
89
component: role-sync-controller
@@ -17,5 +18,4 @@ spec:
1718
containers:
1819
- name: role-sync-controller
1920
image: container-registry.zalando.net/teapot/role-sync-controller:main-1
20-
imagePullPolicy: IfNotPresent
2121
{{ end }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{ if .Cluster.ConfigItems.role_sync_controller_enabled "true" }}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: role-sync-controller
6+
labels:
7+
application: kubernetes
8+
component: role-sync-controller
9+
rules:
10+
- apiGroups: [""]
11+
resources: ["namespaces"]
12+
verbs: ["list"]
13+
- apiGroups: ["rbac.authorization.k8s.io"]
14+
resources: ["rolebindings"]
15+
verbs: ["get", "create", "update"]
16+
---
17+
apiVersion: rbac.authorization.k8s.io/v1
18+
kind: ClusterRoleBinding
19+
metadata:
20+
name: role-sync-controller
21+
labels:
22+
application: kubernetes
23+
component: role-sync-controller
24+
roleRef:
25+
apiGroup: rbac.authorization.k8s.io
26+
kind: ClusterRole
27+
name: role-sync-controller
28+
subjects:
29+
- kind: ServiceAccount
30+
name: role-sync-controller
31+
namespace: kube-system
32+
{{ end }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ if .Cluster.ConfigItems.role_sync_controller_enabled "true" }}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: role-sync-controller
6+
namespace: kube-system
7+
labels:
8+
application: kubernetes
9+
component: role-sync-controller
10+
{{ end }}

0 commit comments

Comments
 (0)