BorislavG | 3dad2f4 | 2018-04-16 10:19:45 +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: |
| 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" . }} |
| 29 | spec: |
| 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 | --- |
| 40 | kind: PersistentVolume |
| 41 | apiVersion: v1 |
| 42 | metadata: |
| 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" . }} |
| 51 | spec: |
| 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 | --- |
| 63 | kind: PersistentVolume |
| 64 | apiVersion: v1 |
| 65 | metadata: |
| 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" . }} |
| 74 | spec: |
| 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 | --- |
| 86 | kind: PersistentVolume |
| 87 | apiVersion: v1 |
| 88 | metadata: |
| 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" . }} |
| 97 | spec: |
| 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 | --- |
| 109 | kind: PersistentVolume |
| 110 | apiVersion: v1 |
| 111 | metadata: |
| 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" . }} |
| 120 | spec: |
| 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 -}} |