Add missing selectors on PVC

Change-Id: If156e738a26c7c19043657c97ac327125c5162db
Issue-ID: OOM-1486
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
diff --git a/kubernetes/common/cassandra/templates/statefulset.yaml b/kubernetes/common/cassandra/templates/statefulset.yaml
index b6bd8f6..960d97e 100644
--- a/kubernetes/common/cassandra/templates/statefulset.yaml
+++ b/kubernetes/common/cassandra/templates/statefulset.yaml
@@ -143,4 +143,7 @@
         resources:
           requests:
             storage: {{ .Values.persistence.size | quote }}
+        selector:
+          matchLabels:
+            release: "{{ .Release.Name }}"
   {{- end }}
diff --git a/kubernetes/common/mariadb-galera/templates/statefulset.yaml b/kubernetes/common/mariadb-galera/templates/statefulset.yaml
index d3bad4f..2266bfc 100644
--- a/kubernetes/common/mariadb-galera/templates/statefulset.yaml
+++ b/kubernetes/common/mariadb-galera/templates/statefulset.yaml
@@ -126,4 +126,7 @@
       resources:
         requests:
           storage: {{ .Values.persistence.size | quote }}
+      selector:
+        matchLabels:
+          name: {{ include "common.fullname" . }}
 {{- end }}
diff --git a/kubernetes/common/mongo/templates/pvc.yaml b/kubernetes/common/mongo/templates/pvc.yaml
index d1558f1..372c106 100644
--- a/kubernetes/common/mongo/templates/pvc.yaml
+++ b/kubernetes/common/mongo/templates/pvc.yaml
@@ -25,6 +25,7 @@
     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
     release: "{{ .Release.Name }}"
     heritage: "{{ .Release.Service }}"
+    name: {{ include "common.fullname" . }}
 {{- if .Values.persistence.annotations }}
   annotations:
 {{ toYaml .Values.persistence.annotations | indent 4 }}
@@ -35,5 +36,8 @@
   resources:
     requests:
       storage: {{ .Values.persistence.size }}
+  selector:
+    matchLabels:
+      name: {{ include "common.fullname" . }}
   storageClassName: "{{ include "common.fullname" . }}-data"
 {{- end -}}
diff --git a/kubernetes/common/music/charts/music-cassandra/templates/statefulset.yaml b/kubernetes/common/music/charts/music-cassandra/templates/statefulset.yaml
index e67a2c3..009c40d 100644
--- a/kubernetes/common/music/charts/music-cassandra/templates/statefulset.yaml
+++ b/kubernetes/common/music/charts/music-cassandra/templates/statefulset.yaml
@@ -132,4 +132,7 @@
         resources:
           requests:
             storage: {{ .Values.persistence.size | quote }}
+        selector:
+          matchLabels:
+            release: "{{ .Release.Name }}"
   {{- end }}
diff --git a/kubernetes/common/music/charts/zookeeper/templates/statefulset.yaml b/kubernetes/common/music/charts/zookeeper/templates/statefulset.yaml
index 1efd466..135b59e 100644
--- a/kubernetes/common/music/charts/zookeeper/templates/statefulset.yaml
+++ b/kubernetes/common/music/charts/zookeeper/templates/statefulset.yaml
@@ -185,4 +185,7 @@
         resources:
           requests:
             storage: {{ .Values.persistence.size | quote }}
+        selector:
+          matchLabels:
+            release: "{{ .Release.Name }}"
   {{- end }}
diff --git a/kubernetes/common/mysql/templates/statefulset.yaml b/kubernetes/common/mysql/templates/statefulset.yaml
index 1744940..f73b10f 100644
--- a/kubernetes/common/mysql/templates/statefulset.yaml
+++ b/kubernetes/common/mysql/templates/statefulset.yaml
@@ -251,4 +251,7 @@
       resources:
         requests:
           storage: {{ .Values.persistence.size }}
+      selector:
+        matchLabels:
+          name: {{ include "common.fullname" . }}
   {{ end }}
diff --git a/kubernetes/common/postgres/templates/statefulset.yaml b/kubernetes/common/postgres/templates/statefulset.yaml
index 3c7ae65..db4a256 100644
--- a/kubernetes/common/postgres/templates/statefulset.yaml
+++ b/kubernetes/common/postgres/templates/statefulset.yaml
@@ -149,4 +149,7 @@
       resources:
         requests:
           storage: {{ .Values.persistence.size }}
+      selector:
+        matchLabels:
+          name: {{ include "common.fullname" . }}
 #{{ end }}