forked from robusta-dev/krr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single_namespace_permissions.yaml
42 lines (42 loc) · 1.14 KB
/
single_namespace_permissions.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Test environment for per-namespace scans
# The purpose of this setup is to verify that per-namespace features work without cluster level permissions
# You can test this ServiceAccount and KRR using:
# krr simple --as system:serviceaccount:kube-system:krr-account -n kube-system
apiVersion: v1
kind: ServiceAccount
metadata:
name: krr-account
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: kube-system
name: krr-role
rules:
- apiGroups: [""]
resources: ["pods", "services"]
verbs: ["get", "watch", "list"]
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["get", "watch", "list"]
- apiGroups: ["apps"]
resources: ["deployments", "replicasets", "daemonsets", "statefulsets"]
verbs: ["get", "list", "watch"]
- apiGroups: ["autoscaling"]
resources: ["horizontalpodautoscalers"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: krr-role-binding
namespace: kube-system
subjects:
- kind: ServiceAccount
name: krr-account
namespace: kube-system
roleRef:
kind: Role
name: krr-role
apiGroup: rbac.authorization.k8s.io