Merge "Mavenized image creation for readiness-check"
[oom.git] / kubernetes / appc / templates / pv.yaml
index 25257ea..955285b 100644 (file)
 */}}
 {{- $global := . }}
 {{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) -}}
+{{- if eq "True" (include "common.needPV" .) -}}
 {{- range $i, $t := until (int $global.Values.replicaCount)}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" $global }}-data{{$i}}
+  name: {{ include "common.fullname" $global }}-data-{{$i}}
   namespace: {{ include "common.namespace" $global }}
   labels:
     app: {{ include "common.fullname" $global }}
@@ -36,6 +37,9 @@ spec:
   persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
   hostPath:
     path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}{{$i}}
+{{if ne $i (int $global.Values.replicaCount) }}
 ---
 {{- end -}}
 {{- end -}}
+{{- end -}}
+{{- end -}}