jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 1 | {{/* |
| 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 }} |
| 18 | kind: PersistentVolume |
| 19 | apiVersion: v1 |
| 20 | metadata: |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 21 | name: {{ include "common.fullname" . }}-mdsal0 |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 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" . }} |
| 29 | spec: |
| 30 | capacity: |
| 31 | storage: {{ .Values.persistence.size}} |
| 32 | accessModes: |
| 33 | - {{ .Values.persistence.accessMode }} |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 34 | storageClassName: "{{ include "common.fullname" . }}-mdsal" |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 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 | --- |
| 40 | kind: PersistentVolume |
| 41 | apiVersion: v1 |
| 42 | metadata: |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 43 | name: {{ include "common.fullname" . }}-mdsal1 |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 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" . }} |
| 51 | spec: |
| 52 | capacity: |
| 53 | storage: {{ .Values.persistence.size}} |
| 54 | accessModes: |
| 55 | - {{ .Values.persistence.accessMode }} |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 56 | storageClassName: "{{ include "common.fullname" . }}-mdsal" |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 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 | --- |
| 63 | kind: PersistentVolume |
| 64 | apiVersion: v1 |
| 65 | metadata: |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 66 | name: {{ include "common.fullname" . }}-mdsal2 |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 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" . }} |
| 74 | spec: |
| 75 | capacity: |
| 76 | storage: {{ .Values.persistence.size}} |
| 77 | accessModes: |
| 78 | - {{ .Values.persistence.accessMode }} |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 79 | storageClassName: "{{ include "common.fullname" . }}-mdsal" |
jmac | 8d6dc96 | 2018-04-26 14:26:55 +0000 | [diff] [blame] | 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 }} |
Mohammadreza Pasandideh | cffec6d | 2018-05-08 17:42:11 -0400 | [diff] [blame] | 84 | {{- end -}} |