Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database version upgrades #19

Closed
pmig opened this issue Dec 20, 2022 · 2 comments
Closed

Database version upgrades #19

pmig opened this issue Dec 20, 2022 · 2 comments

Comments

@pmig
Copy link
Contributor

pmig commented Dec 20, 2022

Thank you for your operator. It works quite well! (Despite the helm repo https://charts.mmontes-dev.duckdns.org/ is often not available)

MariaDB Version Tags are immutable.

What is the recommanded upgrade path?

@mmontes11
Copy link
Member

mmontes11 commented Dec 20, 2022

Thanks a lot!

Regarding the helm repo, I've just updated the docs pointing to the new one (https://charts.mmontes.duckdns.org ). We have some plans to improve the experience installing our chart:

MariaDB Version Tags are immutable
What is the recommanded upgrade path

That's right, this is not documented yet but the unoficial approach would be:

  1. Create a MariaDB resource
apiVersion: database.mmontes.io/v1alpha1
kind: MariaDB
metadata:
  name: mariadb
spec:
  rootPasswordSecretKeyRef:
    name: mariadb
    key: root-password
  image:
    repository: mariadb
    tag: "10.7.4"
    pullPolicy: IfNotPresent
  port: 3306
  volumeClaimTemplate:
    resources:
      requests:
        storage: 100Mi
    storageClassName: standard
    accessModes:
      - ReadWriteOnce
  1. Take a backup
apiVersion: database.mmontes.io/v1alpha1
kind: BackupMariaDB
metadata:
  name: backup
spec:
  mariaDbRef:
    name: mariadb
  storage:
    persistentVolumeClaim:
      resources:
        requests:
          storage: 100Mi
      storageClassName: standard
      accessModes:
        - ReadWriteOnce
  1. Create a new MariaDB instance bumping the version and bootstrapping from backup:
apiVersion: database.mmontes.io/v1alpha1
kind: MariaDB
metadata:
 name: mariadb-from-backup
spec:
 rootPasswordSecretKeyRef:
   name: mariadb
   key: root-password
 image:
   repository: mariadb
   tag: "10.9.4"
   pullPolicy: IfNotPresent
 port: 3306
 volumeClaimTemplate:
   resources:
     requests:
       storage: 100Mi
   storageClassName: standard
   accessModes:
     - ReadWriteOnce
 bootstrapFromBackupRef:
   name: backup

When the new one is marked as Ready you can swap the labels in your Service to forward the traffic to it. I hope it makes sense, let me know otherwise.

We have plans to create a proper documentation with this kind of scenarios:

@mmontes11
Copy link
Member

Closing. Please @pmig reopen if you need further help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants