adding a selector in so/mariadb/pvc 81/35281/1
authorJerome Doucerain <jerome.doucerain@bell.ca>
Sat, 3 Mar 2018 03:14:27 +0000 (22:14 -0500)
committerJerome Doucerain <jerome.doucerain@bell.ca>
Sat, 3 Mar 2018 03:19:25 +0000 (22:19 -0500)
to be sure the pvc will properly be bound to the expected pv
a label has been added to the pv and a selector on matchlabels
has been added to the pvc

Issue-ID: OOM-786

Change-Id: Ic1c89efc2632623f9bf6467ebc1fd24b3cb4fb93
Signed-off-by: Jerome Doucerain <jerome.doucerain@bell.ca>
kubernetes/so/charts/mariadb/templates/pv.yaml
kubernetes/so/charts/mariadb/templates/pvc.yaml

index 27343e3..31230a9 100644 (file)
@@ -9,6 +9,7 @@ metadata:
     chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
     release: "{{ .Release.Name }}"
     heritage: "{{ .Release.Service }}"
+    name: {{ include "common.fullname" . }}
 spec:
   capacity:
     storage: {{ .Values.persistence.size}}
@@ -17,4 +18,4 @@ spec:
   persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
   hostPath:
     path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
-{{- end -}}
\ No newline at end of file
+{{- end -}}
index faff46c..b0cd3bf 100644 (file)
@@ -14,6 +14,9 @@ metadata:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
 {{- end }}
 spec:
+  selector:
+    matchLabels:
+      name: {{ include "common.fullname" . }}
   accessModes:
     - {{ .Values.persistence.accessMode }}
   resources: