e3b589e9fa39d809ebccbbb31c7376058b8f125c
[ta/caas-security.git] / rbac_manifests / svcwatcher-rbac-config.yml
1 ---
2 # Copyright 2019 Nokia
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 apiVersion: v1
17 kind: ServiceAccount
18 metadata:
19   name: svcwatcher
20   namespace: kube-system
21   labels:
22       kubernetes.io/cluster-service: "true"
23 ---
24 apiVersion: rbac.authorization.k8s.io/v1
25 kind: ClusterRole
26 metadata:
27   name: caas:svcwatcher
28 rules:
29 - apiGroups:
30   - ""
31   resources:
32   - endpoints
33   verbs:
34   - list
35   - watch
36   - get
37   - update
38   - create
39   - delete
40 - apiGroups:
41   - ""
42   resources:
43   - services
44   - pods
45   verbs:
46   - list
47   - watch
48   - get
49 - apiGroups:
50   - "danm.k8s.io"
51   resources:
52   - danmeps
53   verbs:
54   - get
55   - list
56   - watch
57   - create
58   - update
59   - patch
60   - delete
61 ---
62 apiVersion: rbac.authorization.k8s.io/v1
63 kind: ClusterRoleBinding
64 metadata:
65   name: caas:svcwatcher
66 roleRef:
67   apiGroup: rbac.authorization.k8s.io
68   kind: ClusterRole
69   name: caas:svcwatcher
70 subjects:
71 - kind: ServiceAccount
72   namespace: kube-system
73   name: svcwatcher
74 ---
75 apiVersion: rbac.authorization.k8s.io/v1
76 kind: ClusterRoleBinding
77 metadata:
78   name: caas:svcwatcher-psp
79 subjects:
80 - kind: ServiceAccount
81   name: svcwatcher
82   namespace: kube-system
83 roleRef:
84   kind: ClusterRole
85   name: caas:infra-psp
86   apiGroup: rbac.authorization.k8s.io