-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathconfig-standalone-rbac.yaml
93 lines (93 loc) · 2.75 KB
/
config-standalone-rbac.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
name: config-standalone-rbac
namespace: policy-test
spec:
disabled: false
policy-templates:
- objectDefinition:
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: config-standalone-rbac
spec:
pruneObjectBehavior: DeleteAll
remediationAction: enforce
object-templates:
- complianceType: musthave
objectDefinition:
apiVersion: v1
kind: ConfigMap
metadata:
name: standalone-hubtemplates-test
namespace: local-cluster
data:
foo: bar
- complianceType: musthave
objectDefinition:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: cm-reader
namespace: local-cluster
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- complianceType: musthave
objectDefinition:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: cm-reader-binding
namespace: local-cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cm-reader
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:open-cluster-management:cluster:local-cluster:addon:governance-standalone-hub-templating
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: config-standalone-rbac
namespace: policy-test
spec:
tolerations:
- key: cluster.open-cluster-management.io/unreachable
operator: Exists
- key: cluster.open-cluster-management.io/unavailable
operator: Exists
clusterSets:
- global
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: name
operator: In
values:
- local-cluster
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
name: config-standalone-rbac
namespace: policy-test
placementRef:
name: config-standalone-rbac
apiGroup: cluster.open-cluster-management.io
kind: Placement
subjects:
- name: config-standalone-rbac
apiGroup: policy.open-cluster-management.io
kind: Policy