[COMMON] Fix PV/PVC for postgres 67/100667/2
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 23 Jan 2020 10:45:43 +0000 (11:45 +0100)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 23 Jan 2020 11:00:58 +0000 (12:00 +0100)
When creating https://gerrit.onap.org/r/c/oom/+/99478, forgot to
backport storage class part of https://gerrit.onap.org/r/c/oom/+/98962.

Issue-ID: OOM-2234
Issue-ID: OOM-1227
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: I3c42b28ad5bea67eda004b0209c8a21783b539f1

kubernetes/common/postgres/templates/pv-primary.yaml
kubernetes/common/postgres/templates/pv-replica.yaml
kubernetes/common/postgres/templates/pvc-primary.yaml
kubernetes/common/postgres/templates/pvc-replica.yaml

index 096f0c9..1764868 100644 (file)
@@ -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 -}}
index a98abef..b67cac0 100644 (file)
@@ -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 -}}
index 05a5088..e529da1 100644 (file)
@@ -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 -}}
index f740521..41199b6 100644 (file)
@@ -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 -}}