Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 1 | {{/* |
| 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 Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame^] | 17 | {{- if and .Values.global.persistence.enabled (not .Values.persistence.config.existingClaim) }} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 18 | kind: PersistentVolume |
| 19 | apiVersion: v1 |
| 20 | metadata: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame^] | 21 | name: {{ .Release.Name }}-config |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame^] | 24 | app: {{ include "common.name" . }}-config |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 25 | chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" |
| 26 | release: "{{ .Release.Name }}" |
| 27 | heritage: "{{ .Release.Service }}" |
| 28 | name: {{ include "common.fullname" . }} |
| 29 | spec: |
| 30 | capacity: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame^] | 31 | storage: {{ .Values.persistence.config.size}} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 32 | accessModes: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame^] | 33 | - {{ .Values.persistence.config.accessMode }} |
| 34 | persistentVolumeReclaimPolicy: {{ .Values.persistence.config.volumeReclaimPolicy }} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 35 | hostPath: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame^] | 36 | 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) }} |
| 47 | kind: PersistentVolume |
| 48 | apiVersion: v1 |
| 49 | metadata: |
| 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" . }} |
| 58 | spec: |
| 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 }} |