d827b7273aaa76ca80656478aa0d3e1b9a9f6618
[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   - danmnets
53   - danmeps
54   verbs:
55   - get
56   - list
57   - watch
58   - create
59   - update
60   - patch
61   - delete
62 ---
63 apiVersion: rbac.authorization.k8s.io/v1
64 kind: ClusterRoleBinding
65 metadata:
66   name: caas:svcwatcher
67 roleRef:
68   apiGroup: rbac.authorization.k8s.io
69   kind: ClusterRole
70   name: caas:svcwatcher
71 subjects:
72 - kind: ServiceAccount
73   namespace: kube-system
74   name: svcwatcher
75 ---
76 apiVersion: rbac.authorization.k8s.io/v1
77 kind: ClusterRoleBinding
78 metadata:
79   name: caas:svcwatcher-psp
80 subjects:
81 - kind: ServiceAccount
82   name: svcwatcher
83   namespace: kube-system
84 roleRef:
85   kind: ClusterRole
86   name: caas:infra-psp
87   apiGroup: rbac.authorization.k8s.io