Skip to content

Upgrade guide v0.0.30

This guide illustrates, step by step, how to migrate to v0.0.30 from previous versions.

This release ships outstanding changes that make the Galera recovery process notably more robust. For making this possible, the v0.0.30 operator relies some functionality available in both the init and agent containers used for Galera, so they both need to be updated to v0.0.30 as detailed in further steps.

  • Uninstall you current mariadb-operator for preventing conflicts:
helm uninstall mariadb-operator

Alternatively, you may only downscale and delete the webhook configurations:

kubectl scale deployment mariadb-operator --replicas=0
kubectl scale deployment mariadb-operator-webhook --replicas=0
kubectl delete validatingwebhookconfiguration mariadb-operator-webhook
kubectl delete mutatingwebhookconfiguration mariadb-operator-webhook
  • Upgrade CRDs to v0.0.30:

    [!IMPORTANT]
    Helm does not handle CRD upgrades. See helm docs.

kubectl replace -f https://github.com/mariadb-operator/mariadb-operator/releases/download/helm-chart-0.30.0/crds.yaml
  • If you are using Galera, apply the following changes in the MariaDB resources:

Update the init and agent containers to v0.0.30:

apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
  name: mariadb
spec:
  galera:
    agent:
-      image: docker-registry3.mariadb.com/mariadb-operator/mariadb-operator:v0.0.29
+      image: docker-registry3.mariadb.com/mariadb-operator/mariadb-operator:v0.0.30
    initContainer:
-      image: docker-registry3.mariadb.com/mariadb-operator/mariadb-operator:v0.0.29
+      image: docker-registry3.mariadb.com/mariadb-operator/mariadb-operator:v0.0.30

podSyncTimeout and podRecoveryTimeout defaults have been bumped to 5m, make sure you bump them as well to at least 5m:

apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
  name: mariadb
spec:
  galera:
    recovery:
-      podRecoveryTimeout: 3m
+      podRecoveryTimeout: 5m
-      podSyncTimeout: 3m
+      podSyncTimeout: 5m

minClusterSize defaults to 1 replica now, which means that the recovery process will only be triggered when all the Pods are down. This is the recommended setting now, as it fits better the new recovery process:

apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
  name: mariadb
spec:
  galera:
    recovery:
-      minClusterSize: "50%"
+      minClusterSize: 1

If you are using a service mesh like Istio or Linkerd, make sure you add the corresponding metadata to make sure that the new recovery Jobs complete, more information can be found here:

apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
  name: mariadb-galera
spec:
  galera:
    recovery:
+      job:
+        metadata:
+          labels:
+            sidecar.istio.io/inject: "false"
  • Upgrade mariadb-operator to v0.0.30:
helm repo update mariadb-operator
helm upgrade --install mariadb-operator mariadb-operator/mariadb-operator --version 0.30.0 
  • If you previously decided to downscale the operator, make sure you upscale it back:
kubectl scale deployment mariadb-operator -n default --replicas=1
kubectl scale deployment mariadb-operator-webhook -n default --replicas=1