From c81e042331d003c307c6aefb5378a1e30ccf744f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20J=2E=20Salmer=C3=B3n-Garc=C3=ADa?= Date: Thu, 20 Sep 2018 13:28:18 +0200 Subject: [PATCH] [stable/mariadb] Fix chart not being upgradable (#7852) Signed-off-by: Javier J. Salmeron Garcia --- stable/mariadb/Chart.yaml | 2 +- stable/mariadb/README.md | 11 +++++++++++ stable/mariadb/templates/master-statefulset.yaml | 7 ++++++- stable/mariadb/templates/slave-statefulset.yaml | 5 +++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/stable/mariadb/Chart.yaml b/stable/mariadb/Chart.yaml index db79cd7059..7ab7395471 100644 --- a/stable/mariadb/Chart.yaml +++ b/stable/mariadb/Chart.yaml @@ -1,5 +1,5 @@ name: mariadb -version: 4.4.2 +version: 5.0.0 appVersion: 10.1.36 description: Fast, reliable, scalable, and easy to use open-source relational database system. MariaDB Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. Highly available MariaDB cluster. keywords: diff --git a/stable/mariadb/README.md b/stable/mariadb/README.md index 09dcde52c3..6b2de1f675 100644 --- a/stable/mariadb/README.md +++ b/stable/mariadb/README.md @@ -147,3 +147,14 @@ The allowed extensions are `.sh`, `.sql` and `.sql.gz`. The [Bitnami MariaDB](https://github.com/bitnami/bitnami-docker-mariadb) image stores the MariaDB data and configurations at the `/bitnami/mariadb` path of the container. The chart mounts a [Persistent Volume](kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning, by default. An existing PersistentVolumeClaim can be defined. + +## Upgrading + +### To 5.0.0 + +Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments. +Use the workaround below to upgrade from versions previous to 5.0.0. The following example assumes that the release name is mariadb: + +```console +$ kubectl delete statefulset opencart-mariadb --cascade=false +``` diff --git a/stable/mariadb/templates/master-statefulset.yaml b/stable/mariadb/templates/master-statefulset.yaml index 0d25d5fc77..b1b1af67c5 100644 --- a/stable/mariadb/templates/master-statefulset.yaml +++ b/stable/mariadb/templates/master-statefulset.yaml @@ -9,6 +9,11 @@ metadata: release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} spec: + selector: + matchLabels: + release: "{{ .Release.Name }}" + component: "master" + app: {{ template "mariadb.name" . }} serviceName: "{{ template "master.fullname" . }}" replicas: 1 updateStrategy: @@ -208,4 +213,4 @@ spec: {{- else }} - name: "data" emptyDir: {} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/stable/mariadb/templates/slave-statefulset.yaml b/stable/mariadb/templates/slave-statefulset.yaml index 3eae43784d..383d0ac75d 100644 --- a/stable/mariadb/templates/slave-statefulset.yaml +++ b/stable/mariadb/templates/slave-statefulset.yaml @@ -10,6 +10,11 @@ metadata: release: {{ .Release.Name | quote }} heritage: {{ .Release.Service | quote }} spec: + selector: + matchLabels: + release: "{{ .Release.Name }}" + component: "slave" + app: {{ template "mariadb.name" . }} serviceName: "{{ template "slave.fullname" . }}" replicas: {{ .Values.slave.replicas }} updateStrategy: