blob: 5a6566a80ba0068fed00cc92c3e8bda8f161c54e [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 -}}
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +000085{{ if .Values.certpersistence.enabled }}
86---
87kind: PersistentVolume
88apiVersion: v1
89metadata:
90 name: {{ include "common.fullname" . }}-pv-certs
91 namespace: {{ include "common.namespace" . }}
92 labels:
93 app: {{ include "common.name" . }}-pv-certs
94 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
95 release: "{{ .Release.Name }}"
96 heritage: "{{ .Release.Service }}"
97 name: {{ include "common.fullname" . }}-certs
98spec:
99 capacity:
100 storage: {{ .Values.certpersistence.size }}
101 accessModes:
102 - {{ .Values.certpersistence.accessMode }}
103{{- if .Values.certpersistence.storageClass }}
104{{- if (eq "-" .Values.certpersistence.storageClass) }}
105 storageClassName: ""
106{{- else }}
107 storageClassName: "{{ .Values.certpersistence.storageClass }}"
108{{- end }}
109{{- end }}
110 persistentVolumeReclaimPolicy: {{ .Values.certpersistence.volumeReclaimPolicy }}
111 hostPath:
112 path: {{ .Values.global.persistence.mountPath | default .Values.certpersistence.mountPath }}/{{ .Values.certpersistence.mountSubPath }}
113{{ end }}
114
115
116