blob: f10d67ad68974e0e301dd99afc9b83cad9251d0b [file] [log] [blame]
jmac8d6dc962018-04-26 14:26:55 +00001{{/*
2# Copyright © 2018 Amdocs, AT&T, Bell Canada
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 and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
17{{ $pvNum := default 1 .Values.replicaCount | int }}
18kind: PersistentVolume
19apiVersion: v1
20metadata:
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -040021 name: {{ include "common.fullname" . }}-mdsal0
jmac8d6dc962018-04-26 14:26:55 +000022 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.fullname" . }}
25 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
26 release: "{{ .Release.Name }}"
27 heritage: "{{ .Release.Service }}"
28 name: {{ include "common.fullname" . }}
29spec:
30 capacity:
31 storage: {{ .Values.persistence.size}}
32 accessModes:
33 - {{ .Values.persistence.accessMode }}
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -040034 storageClassName: "{{ include "common.fullname" . }}-mdsal"
jmac8d6dc962018-04-26 14:26:55 +000035 persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
36 hostPath:
37 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}0
38{{ if gt $pvNum 1 }}
39---
40kind: PersistentVolume
41apiVersion: v1
42metadata:
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -040043 name: {{ include "common.fullname" . }}-mdsal1
jmac8d6dc962018-04-26 14:26:55 +000044 namespace: {{ include "common.namespace" . }}
45 labels:
46 app: {{ include "common.fullname" . }}
47 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
48 release: "{{ .Release.Name }}"
49 heritage: "{{ .Release.Service }}"
50 name: {{ include "common.fullname" . }}
51spec:
52 capacity:
53 storage: {{ .Values.persistence.size}}
54 accessModes:
55 - {{ .Values.persistence.accessMode }}
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -040056 storageClassName: "{{ include "common.fullname" . }}-mdsal"
jmac8d6dc962018-04-26 14:26:55 +000057 persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
58 hostPath:
59 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}1
60{{ end }}
61{{ if gt $pvNum 2 }}
62---
63kind: PersistentVolume
64apiVersion: v1
65metadata:
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -040066 name: {{ include "common.fullname" . }}-mdsal2
jmac8d6dc962018-04-26 14:26:55 +000067 namespace: {{ include "common.namespace" . }}
68 labels:
69 app: {{ include "common.fullname" . }}
70 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
71 release: "{{ .Release.Name }}"
72 heritage: "{{ .Release.Service }}"
73 name: {{ include "common.fullname" . }}
74spec:
75 capacity:
76 storage: {{ .Values.persistence.size}}
77 accessModes:
78 - {{ .Values.persistence.accessMode }}
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -040079 storageClassName: "{{ include "common.fullname" . }}-mdsal"
jmac8d6dc962018-04-26 14:26:55 +000080 persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
81 hostPath:
82 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}2
83{{ end }}
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -040084{{- end -}}