Merge R3 into master
[it/dep.git] / ric-aux / helm / dashboard / templates / persistentVolume.yaml
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #   Copyright (c) 2019 Nokia.                                                  #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 {{- if not .Values.dashboard.storageclass }}
18
19 kind: StorageClass
20 apiVersion: storage.k8s.io/v1
21 metadata:
22   name: storageclass-{{ include "common.name.dashboard" . }}
23 provisioner: kubernetes.io/no-provisioner
24 volumeBindingMode: WaitForFirstConsumer
25
26 ---
27
28 apiVersion: v1
29 kind: PersistentVolume
30 metadata:
31   name: pv-{{ include "common.name.dashboard" . }}
32 spec:
33   capacity:
34     storage: {{ .Values.dashboard.storagesize }}
35   accessModes:
36   - ReadWriteOnce
37   persistentVolumeReclaimPolicy: Retain
38   storageClassName: storageclass-{{ include "common.name.dashboard" . }}
39   local:
40     path: {{ .Values.dashboard.datapath }}
41   nodeAffinity:
42     required:
43       nodeSelectorTerms:
44       - matchExpressions:
45         - key: local-storage
46           operator: In
47           values:
48           - enable
49 {{- end -}}
50