Zack Williams | 618ab86 | 2018-08-03 10:12:54 -0700 | [diff] [blame] | 1 | --- |
| 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 | |
| 20 | apiVersion: v1 |
| 21 | kind: Namespace |
| 22 | metadata: |
| 23 | name: {{ .Values.rookClusterNamespace }} |
| 24 | |
| 25 | --- |
| 26 | # Next 3 items: Allow the pods in this namespace to work with configmaps |
| 27 | apiVersion: v1 |
| 28 | kind: ServiceAccount |
| 29 | metadata: |
| 30 | name: rook-ceph-cluster |
| 31 | namespace: {{ .Values.rookClusterNamespace }} |
| 32 | |
| 33 | --- |
| 34 | kind: Role |
| 35 | apiVersion: rbac.authorization.k8s.io/v1 |
| 36 | metadata: |
| 37 | name: rook-ceph-cluster |
| 38 | namespace: {{ .Values.rookClusterNamespace }} |
| 39 | rules: |
| 40 | - apiGroups: [""] |
| 41 | resources: ["configmaps"] |
| 42 | verbs: [ "get", "list", "watch", "create", "update", "delete" ] |
| 43 | |
| 44 | --- |
| 45 | kind: RoleBinding |
| 46 | apiVersion: rbac.authorization.k8s.io/v1 |
| 47 | metadata: |
| 48 | name: rook-ceph-cluster |
| 49 | namespace: {{ .Values.rookClusterNamespace }} |
| 50 | roleRef: |
| 51 | apiGroup: rbac.authorization.k8s.io |
| 52 | kind: Role |
| 53 | name: rook-ceph-cluster |
| 54 | subjects: |
| 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 |
| 61 | kind: RoleBinding |
| 62 | apiVersion: rbac.authorization.k8s.io/v1 |
| 63 | metadata: |
| 64 | name: rook-ceph-cluster-mgmt |
| 65 | namespace: {{ .Values.rookClusterNamespace }} |
| 66 | roleRef: |
| 67 | apiGroup: rbac.authorization.k8s.io |
| 68 | kind: ClusterRole |
| 69 | name: rook-ceph-cluster-mgmt |
| 70 | subjects: |
| 71 | - kind: ServiceAccount |
| 72 | name: rook-ceph-system |
| 73 | namespace: {{ .Values.rookSystemNamespace }} |
| 74 | |