blob: 16f0805632a5cbc9ae35df05b7b2db574d32463a (
plain)
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
|
# Test environment for per-namespace scans using a group object ID (for e.g. Microsoft Entra)
# The purpose of this setup is to verify that per-namespace features work without cluster level permissions
# You can test this Group and KRR using:
# A user named aksdev that's part of the appdev group.
# krr simple --as aksdev --as-group <appdev-groupID> -n 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: Group
# Replace <appdev-groupID> with the actual Group Object ID
name: <appdev-groupID>
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: krr-role
apiGroup: rbac.authorization.k8s.io
|