How to Reset a Cluster (from node 0)
If any other node than node 0 has further proceeded in transactions, this will result in data loss. Always take a backup of the data directory before taking any further steps.
If the cluster lost a majority of nodes, it won’t be able to start again on it’s own. Since it can’t know which node has the latest data, you need to force the bootstrap.
See Bootstraping a Node if you have to reset the cluster from another node than node 0.
Any of the following changes will be reset if a change to the MariaDB service (Crossplane composition) is being rolled out.
kubectl -n $INSTANCE_ID scale statefulset mariadb \ --replicas 1
kubectl -n $INSTANCE_ID set env statefulset/mariadb \ -c mariadb-galera \ MARIADB_GALERA_FORCE_SAFETOBOOTSTRAP="yes"
kubectl -n $INSTANCE_ID delete pods -l app.kubernetes.io/name=mariadb-galera
kubectl -n $INSTANCE_ID set env statefulset/mariadb -c mariadb-galera \ MARIADB_GALERA_FORCE_SAFETOBOOTSTRAP="no"