Skip to content

Commit 5362f0b

Browse files
committed
feat: Configure sandbox controller
Add necessary RBAC manifests (ServiceAccount, ClusterRole, and ClusterRoleBinding) for the sandbox controller. This grants the controller permissions to manage sandbox, routegroup, and ingress resources. Wrap the sandbox CRD manifest in the same configuration flag (sandbox_controller_enabled) as the new RBAC manifests. This ensures that the CRD and RBAC are only deployed if the sandbox controller is enabled in the cluster configuration. Signed-off-by: Aleksandr Ponimaskin <[email protected]>
1 parent 555969c commit 5362f0b

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{{ if eq .Cluster.ConfigItems.sandbox_controller_enabled "true" }}
2+
3+
apiVersion: v1
4+
kind: ServiceAccount
5+
metadata:
6+
name: sandbox-controller
7+
namespace: kube-system
8+
labels:
9+
application: sandbox-controller
10+
component: sandbox-controller
11+
---
12+
apiVersion: rbac.authorization.k8s.io/v1
13+
kind: ClusterRole
14+
metadata:
15+
name: sandbox-controller
16+
labels:
17+
application: sandbox-controller
18+
component: sandbox-controller
19+
rules:
20+
- apiGroups:
21+
- zalando.org
22+
resources:
23+
- sandboxes
24+
verbs:
25+
- get
26+
- list
27+
- watch
28+
- apiGroups:
29+
- zalando.org
30+
resources:
31+
- routegroups
32+
verbs:
33+
- list
34+
- watch
35+
- get
36+
- create
37+
- update
38+
- patch
39+
- delete
40+
- apiGroups:
41+
- networking.k8s.io
42+
resources:
43+
- ingresses
44+
verbs:
45+
- list
46+
- watch
47+
- get
48+
- create
49+
- update
50+
- patch
51+
- delete
52+
---
53+
apiVersion: rbac.authorization.k8s.io/v1
54+
kind: ClusterRoleBinding
55+
metadata:
56+
name: sandbox-controller
57+
labels:
58+
application: sandbox-controller
59+
component: sandbox-controller
60+
roleRef:
61+
apiGroup: rbac.authorization.k8s.io
62+
kind: ClusterRole
63+
name: sandbox-controller
64+
subjects:
65+
- kind: ServiceAccount
66+
name: sandbox-controller
67+
namespace: kube-system
68+
{{ end }}

cluster/manifests/sandbox-controller/sandbox_crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ if eq .Cluster.ConfigItems.sandbox_controller_enabled "true" }}
12
apiVersion: apiextensions.k8s.io/v1
23
kind: CustomResourceDefinition
34
metadata:
@@ -34,3 +35,4 @@ spec:
3435
type: string
3536
target:
3637
type: string
38+
{{ end }}

0 commit comments

Comments
 (0)