blob: b2acf373939de486e97937b5b9fb1254773793b2 [file] [log] [blame]
Aaron Hay0fc90762019-03-20 19:48:42 -04001{{/*
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{{- $global := . }}
17{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) -}}
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +010018{{- if eq "True" (include "common.needPV" .) -}}
Aaron Hay0fc90762019-03-20 19:48:42 -040019{{- range $i, $t := until (int $global.Values.replicaCount)}}
20kind: PersistentVolume
21apiVersion: v1
22metadata:
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +010023 name: {{ include "common.fullname" $global }}-playbook-{{$i}}
Aaron Hay0fc90762019-03-20 19:48:42 -040024 namespace: {{ include "common.namespace" $global }}
25 labels:
26 app: {{ include "common.fullname" $global }}
27 chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010028 release: "{{ include "common.release" $global }}"
Aaron Hay0fc90762019-03-20 19:48:42 -040029 heritage: "{{ $global.Release.Service }}"
30 name: {{ include "common.fullname" $global }}
31spec:
32 capacity:
33 storage: {{ $global.Values.persistence.size}}
34 accessModes:
35 - {{ $global.Values.persistence.accessMode }}
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +010036 storageClassName: "{{ include "common.fullname" $global }}-data"
Aaron Hay0fc90762019-03-20 19:48:42 -040037 persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
38 hostPath:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010039 path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ include "common.release" $global }}/{{ $global.Values.persistence.mountSubPath }}{{$i}}
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +010040{{if ne $i (int $global.Values.replicaCount) }}
Aaron Hay0fc90762019-03-20 19:48:42 -040041---
42{{- end -}}
43{{- end -}}
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +010044{{- end -}}
45{{- end -}}