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 | {{- if .Values.common.rbac }} |
| 17 | apiVersion: v1 |
| 18 | kind: Namespace |
| 19 | metadata: |
| 20 | name: {{ .Values.common.namespace }} |
| 21 | |
| 22 | --- |
| 23 | apiVersion: v1 |
| 24 | kind: ServiceAccount |
| 25 | metadata: |
| 26 | name: {{ .Values.daemonset.serviceAccount }} |
| 27 | namespace: {{ .Values.common.namespace }} |
| 28 | |
| 29 | --- |
| 30 | apiVersion: rbac.authorization.k8s.io/v1 |
| 31 | kind: ClusterRoleBinding |
| 32 | metadata: |
| 33 | name: local-storage-provisioner-pv-binding |
| 34 | namespace: {{ .Values.common.namespace }} |
| 35 | subjects: |
| 36 | - kind: ServiceAccount |
| 37 | name: {{ .Values.daemonset.serviceAccount }} |
| 38 | namespace: {{ .Values.common.namespace }} |
| 39 | roleRef: |
| 40 | kind: ClusterRole |
| 41 | name: system:persistent-volume-provisioner |
| 42 | apiGroup: rbac.authorization.k8s.io |
| 43 | |
| 44 | --- |
| 45 | apiVersion: rbac.authorization.k8s.io/v1 |
| 46 | kind: ClusterRole |
| 47 | metadata: |
| 48 | name: local-storage-provisioner-node-clusterrole |
| 49 | namespace: {{ .Values.common.namespace }} |
| 50 | rules: |
| 51 | - apiGroups: [""] |
| 52 | resources: ["nodes"] |
| 53 | verbs: ["get"] |
| 54 | |
| 55 | --- |
| 56 | apiVersion: rbac.authorization.k8s.io/v1 |
| 57 | kind: ClusterRoleBinding |
| 58 | metadata: |
| 59 | name: local-storage-provisioner-node-binding |
| 60 | namespace: {{ .Values.common.namespace }} |
| 61 | subjects: |
| 62 | - kind: ServiceAccount |
| 63 | name: {{ .Values.daemonset.serviceAccount }} |
| 64 | namespace: {{ .Values.common.namespace }} |
| 65 | roleRef: |
| 66 | kind: ClusterRole |
| 67 | name: local-storage-provisioner-node-clusterrole |
| 68 | apiGroup: rbac.authorization.k8s.io |
| 69 | |
| 70 | {{- if .Values.common.useJobForCleaning }} |
| 71 | --- |
| 72 | apiVersion: rbac.authorization.k8s.io/v1 |
| 73 | kind: Role |
| 74 | metadata: |
| 75 | name: local-storage-provisioner-jobs-role |
| 76 | namespace: {{ .Values.common.namespace }} |
| 77 | rules: |
| 78 | - apiGroups: |
| 79 | - 'batch' |
| 80 | resources: |
| 81 | - jobs |
| 82 | verbs: |
| 83 | - '*' |
| 84 | |
| 85 | --- |
| 86 | apiVersion: rbac.authorization.k8s.io/v1 |
| 87 | kind: RoleBinding |
| 88 | metadata: |
| 89 | name: local-storage-provisioner-jobs-rolebinding |
| 90 | namespace: {{ .Values.common.namespace }} |
| 91 | subjects: |
| 92 | - kind: ServiceAccount |
| 93 | name: {{ .Values.daemonset.serviceAccount }} |
| 94 | namespace: {{ .Values.common.namespace }} |
| 95 | roleRef: |
| 96 | kind: Role |
| 97 | name: local-storage-provisioner |
| 98 | apiGroup: rbac.authorization.k8s.io |
| 99 | |
| 100 | {{- end }} # if .Values.common.useJobForCleaning |
| 101 | {{- end }} # if .Values.common.rbac |