blob: 9d281849859298a7208b26620beda775499ff98f [file] [log] [blame]
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +00001{{/*
2# Copyright © 2017 Amdocs, 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
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000017{{- if and .Values.global.persistence.enabled (not .Values.persistence.config.existingClaim) }}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000018kind: PersistentVolume
19apiVersion: v1
20metadata:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000021 name: {{ .Release.Name }}-config
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000022 namespace: {{ include "common.namespace" . }}
23 labels:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000024 app: {{ include "common.name" . }}-config
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000025 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
26 release: "{{ .Release.Name }}"
27 heritage: "{{ .Release.Service }}"
28 name: {{ include "common.fullname" . }}
29spec:
30 capacity:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000031 storage: {{ .Values.persistence.config.size}}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000032 accessModes:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000033 - {{ .Values.persistence.config.accessMode }}
34 persistentVolumeReclaimPolicy: {{ .Values.persistence.config.volumeReclaimPolicy }}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000035 hostPath:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000036 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.config.mountSubPath }}
37{{- if .Values.persistence.config.storageClass }}
38{{- if (eq "-" .Values.persistence.config.storageClass) }}
39 storageClassName: ""
40{{- else }}
41 storageClassName: "{{ .Values.persistence.config.storageClass }}"
42{{- end }}
43{{- end }}
44{{- end }}
45---
46{{- if and .Values.global.persistence.enabled (not .Values.persistence.logs.existingClaim) }}
47kind: PersistentVolume
48apiVersion: v1
49metadata:
50 name: {{ .Release.Name }}-logs
51 namespace: {{ include "common.namespace" . }}
52 labels:
53 app: {{ include "common.name" . }}-logs
54 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
55 release: "{{ .Release.Name }}"
56 heritage: "{{ .Release.Service }}"
57 name: {{ include "common.fullname" . }}
58spec:
59 capacity:
60 storage: {{ .Values.persistence.logs.size}}
61 accessModes:
62 - {{ .Values.persistence.logs.accessMode }}
63 persistentVolumeReclaimPolicy: {{ .Values.persistence.logs.volumeReclaimPolicy }}
64 hostPath:
65 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.logs.mountSubPath }}
66{{- if .Values.persistence.logs.storageClass }}
67{{- if (eq "-" .Values.persistence.logs.storageClass) }}
68 storageClassName: ""
69{{- else }}
70 storageClassName: "{{ .Values.persistence.logs.storageClass }}"
71{{- end }}
72{{- end }}
73{{- end }}