From 65022cdf10d56bd167d26c665e453225597e4c09 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Wed, 27 Nov 2024 16:24:31 -0600 Subject: [PATCH] testing restore/backup --- .../apps/database/mariadb/cluster/backup.yaml | 19 ++++++++++++++++--- .../database/mariadb/cluster/mariadb.yaml | 6 +++--- .../database/mariadb/cluster/restore.yaml | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 kubernetes/apps/database/mariadb/cluster/restore.yaml diff --git a/kubernetes/apps/database/mariadb/cluster/backup.yaml b/kubernetes/apps/database/mariadb/cluster/backup.yaml index 7efeacd3..fd4d9092 100644 --- a/kubernetes/apps/database/mariadb/cluster/backup.yaml +++ b/kubernetes/apps/database/mariadb/cluster/backup.yaml @@ -8,9 +8,22 @@ spec: mariaDbRef: name: mariadb timeZone: "America/Chicago" - schedule: - cron: "0 * * * *" - suspend: false + # schedule: + # cron: "0 * * * *" + # suspend: false + stagingStorage: + persistentVolumeClaim: + storageClassName: openebs-hostpath + resources: + requests: + storage: 6Gi + accessModes: + - ReadWriteOnce + podSecurityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch storage: s3: endpoint: s3.hsn.dev diff --git a/kubernetes/apps/database/mariadb/cluster/mariadb.yaml b/kubernetes/apps/database/mariadb/cluster/mariadb.yaml index 651ef0e5..646edbc5 100644 --- a/kubernetes/apps/database/mariadb/cluster/mariadb.yaml +++ b/kubernetes/apps/database/mariadb/cluster/mariadb.yaml @@ -11,9 +11,9 @@ spec: storage: size: 5Gi storageClassName: openebs-hostpath - bootstrapFrom: - backupRef: - name: mariadb-backup + # bootstrapFrom: + # backupRef: + # name: mariadb-backup maxScale: enabled: true kubernetesService: diff --git a/kubernetes/apps/database/mariadb/cluster/restore.yaml b/kubernetes/apps/database/mariadb/cluster/restore.yaml new file mode 100644 index 00000000..2b6eeb4a --- /dev/null +++ b/kubernetes/apps/database/mariadb/cluster/restore.yaml @@ -0,0 +1,17 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/k8s.mariadb.com/restore_v1alpha1.json +apiVersion: k8s.mariadb.com/v1alpha1 +kind: Restore +metadata: + name: restore +spec: + mariaDbRef: + name: mariadb + namespace: database + backupRef: + name: mariadb-backup + podSecurityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch