blob: 04a9f510a45b0c61b6adb13e77d8b4f932593933 [file] [log] [blame]
Zack Williams618ab862018-08-03 10:12:54 -07001---
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
16kind: StorageClass
17apiVersion: storage.k8s.io/v1
18metadata:
19 name: {{ .Values.storageClassName }}
20provisioner: kubernetes.io/no-provisioner
21volumeBindingMode: WaitForFirstConsumer
22
23{{- range $volume := .Values.volumes }}
24---
25apiVersion: v1
26kind: PersistentVolume
27metadata:
28 name: {{ $volume.name }}
29spec:
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 }}