Zack Williams | 618ab86 | 2018-08-03 10:12:54 -0700 | [diff] [blame] | 1 | --- |
| 2 | # Copyright 2017-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 | kind: StorageClass |
| 17 | apiVersion: storage.k8s.io/v1 |
| 18 | metadata: |
| 19 | name: {{ .Values.storageClassName }} |
| 20 | provisioner: kubernetes.io/no-provisioner |
| 21 | volumeBindingMode: WaitForFirstConsumer |
| 22 | |
| 23 | {{- range $volume := .Values.volumes }} |
| 24 | --- |
| 25 | apiVersion: v1 |
| 26 | kind: PersistentVolume |
| 27 | metadata: |
| 28 | name: {{ $volume.name }} |
| 29 | spec: |
| 30 | capacity: |
| 31 | storage: {{ $volume.size }} |
| 32 | accessModes: |
| 33 | - ReadWriteOnce |
| 34 | persistentVolumeReclaimPolicy: Retain |
| 35 | storageClassName: {{ $.Values.storageClassName }} |
| 36 | local: |
| 37 | path: {{ $volume.directory }} |
| 38 | nodeAffinity: |
| 39 | required: |
| 40 | nodeSelectorTerms: |
| 41 | - matchExpressions: |
| 42 | - key: kubernetes.io/hostname |
| 43 | operator: In |
| 44 | values: |
| 45 | - {{ $volume.host }} |
| 46 | {{- end }} |