diff options
author | Borislav Glozman <Borislav.Glozman@amdocs.com> | 2020-01-26 07:36:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-01-26 07:36:14 +0000 |
commit | ff02910af1fc203e342e621dd4547d51f87e9e9f (patch) | |
tree | 16b5d7226a7e510290daac6dd08c01888d334c78 /kubernetes | |
parent | 9c39401bac43746619482aee239b88db4d2d85e2 (diff) | |
parent | b20067e569ff2ee59b59170089ba1b1efd322acb (diff) |
Merge "[COMMON] Fix PV/PVC for postgres"
Diffstat (limited to 'kubernetes')
4 files changed, 13 insertions, 0 deletions
diff --git a/kubernetes/common/postgres/templates/pv-primary.yaml b/kubernetes/common/postgres/templates/pv-primary.yaml index 096f0c9d2b..1764868ffc 100644 --- a/kubernetes/common/postgres/templates/pv-primary.yaml +++ b/kubernetes/common/postgres/templates/pv-primary.yaml @@ -14,6 +14,7 @@ # # limitations under the License. */}} {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +{{- if include "common.needPV" . -}} kind: PersistentVolume apiVersion: v1 metadata: @@ -35,3 +36,4 @@ spec: hostPath: path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/primary {{- end -}} +{{- end -}} diff --git a/kubernetes/common/postgres/templates/pv-replica.yaml b/kubernetes/common/postgres/templates/pv-replica.yaml index a98abefba0..b67cac0c26 100644 --- a/kubernetes/common/postgres/templates/pv-replica.yaml +++ b/kubernetes/common/postgres/templates/pv-replica.yaml @@ -14,6 +14,7 @@ # # limitations under the License. */}} {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +{{- if include "common.needPV" . -}} kind: PersistentVolume apiVersion: v1 metadata: @@ -35,3 +36,4 @@ spec: hostPath: path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/replica {{- end -}} +{{- end -}} diff --git a/kubernetes/common/postgres/templates/pvc-primary.yaml b/kubernetes/common/postgres/templates/pvc-primary.yaml index 05a5088966..e529da1bd5 100644 --- a/kubernetes/common/postgres/templates/pvc-primary.yaml +++ b/kubernetes/common/postgres/templates/pvc-primary.yaml @@ -36,5 +36,10 @@ spec: resources: requests: storage: {{ .Values.persistence.size }} +{{- if include "common.needPV" . }} + storageClassName: "{{ include "common.fullname" . }}-primary" +{{- else }} + storageClassName: {{ include "common.storageClass" . }} +{{- end }} storageClassName: "{{ include "common.fullname" . }}-primary" {{- end -}} diff --git a/kubernetes/common/postgres/templates/pvc-replica.yaml b/kubernetes/common/postgres/templates/pvc-replica.yaml index f740521919..41199b6861 100644 --- a/kubernetes/common/postgres/templates/pvc-replica.yaml +++ b/kubernetes/common/postgres/templates/pvc-replica.yaml @@ -36,5 +36,9 @@ spec: resources: requests: storage: {{ .Values.persistence.size }} +{{- if include "common.needPV" . }} storageClassName: "{{ include "common.fullname" . }}-replica" +{{- else }} + storageClassName: {{ include "common.storageClass" . }} +{{- end }} {{- end -}} |