blob: 10214097e388f127a90a12345bd5f172c824a0b8 [file] [log] [blame]
BorislavG3dad2f42018-04-16 10:19:45 +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:
21 name: {{ include "common.fullname" . }}-data0
22 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 }}
34 storageClassName: "{{ include "common.fullname" . }}-data"
35 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:
43 name: {{ include "common.fullname" . }}-data1
44 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 }}
56 storageClassName: "{{ include "common.fullname" . }}-data"
57 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:
66 name: {{ include "common.fullname" . }}-data2
67 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 }}
79 storageClassName: "{{ include "common.fullname" . }}-data"
80 persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
81 hostPath:
82 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}2
83{{ end }}
84{{ if gt $pvNum 3 }}
85---
86kind: PersistentVolume
87apiVersion: v1
88metadata:
89 name: {{ include "common.fullname" . }}-data3
90 namespace: {{ include "common.namespace" . }}
91 labels:
92 app: {{ include "common.fullname" . }}
93 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
94 release: "{{ .Release.Name }}"
95 heritage: "{{ .Release.Service }}"
96 name: {{ include "common.fullname" . }}
97spec:
98 capacity:
99 storage: {{ .Values.persistence.size}}
100 accessModes:
101 - {{ .Values.persistence.accessMode }}
102 storageClassName: "{{ include "common.fullname" . }}-data"
103 persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
104 hostPath:
105 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}3
106{{ end }}
107{{ if gt $pvNum 4 }}
108---
109kind: PersistentVolume
110apiVersion: v1
111metadata:
112 name: {{ include "common.fullname" . }}-data4
113 namespace: {{ include "common.namespace" . }}
114 labels:
115 app: {{ include "common.fullname" . }}
116 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
117 release: "{{ .Release.Name }}"
118 heritage: "{{ .Release.Service }}"
119 name: {{ include "common.fullname" . }}
120spec:
121 capacity:
122 storage: {{ .Values.persistence.size}}
123 accessModes:
124 - {{ .Values.persistence.accessMode }}
125 storageClassName: "{{ include "common.fullname" . }}-data"
126 persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
127 hostPath:
128 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}4
129{{ end }}
130{{- end -}}