blob: 9bb4fa6eb6797d4f3bd3be821f37afce906ced45 [file] [log] [blame]
Zack Williams618ab862018-08-03 10:12:54 -07001---
2# Copyright 2018-present Open Networking Foundation
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# For more information, see documentation:
17# https://rook.io/docs/rook/v0.8/rbac.html
18# https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/cluster.yaml
19
20apiVersion: v1
21kind: Namespace
22metadata:
23 name: {{ .Values.rookClusterNamespace }}
24
25---
26# Next 3 items: Allow the pods in this namespace to work with configmaps
27apiVersion: v1
28kind: ServiceAccount
29metadata:
30 name: rook-ceph-cluster
31 namespace: {{ .Values.rookClusterNamespace }}
32
33---
34kind: Role
35apiVersion: rbac.authorization.k8s.io/v1
36metadata:
37 name: rook-ceph-cluster
38 namespace: {{ .Values.rookClusterNamespace }}
39rules:
40- apiGroups: [""]
41 resources: ["configmaps"]
42 verbs: [ "get", "list", "watch", "create", "update", "delete" ]
43
44---
45kind: RoleBinding
46apiVersion: rbac.authorization.k8s.io/v1
47metadata:
48 name: rook-ceph-cluster
49 namespace: {{ .Values.rookClusterNamespace }}
50roleRef:
51 apiGroup: rbac.authorization.k8s.io
52 kind: Role
53 name: rook-ceph-cluster
54subjects:
55- kind: ServiceAccount
56 name: rook-ceph-cluster
57 namespace: {{ .Values.rookClusterNamespace }}
58
59---
60# Allow the operator to create resources in this cluster's namespace
61kind: RoleBinding
62apiVersion: rbac.authorization.k8s.io/v1
63metadata:
64 name: rook-ceph-cluster-mgmt
65 namespace: {{ .Values.rookClusterNamespace }}
66roleRef:
67 apiGroup: rbac.authorization.k8s.io
68 kind: ClusterRole
69 name: rook-ceph-cluster-mgmt
70subjects:
71- kind: ServiceAccount
72 name: rook-ceph-system
73 namespace: {{ .Values.rookSystemNamespace }}
74