Skip to content

Commit

Permalink
Add MariaDB PITR, KubeStash Backup/Restore (#674)
Browse files Browse the repository at this point in the history
Signed-off-by: SK Ali Arman <[email protected]>
  • Loading branch information
sheikh-arman authored Sep 27, 2024
1 parent e6f65f4 commit d7f7094
Show file tree
Hide file tree
Showing 96 changed files with 5,068 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/guides/mariadb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ aliases:
- Use [Custom RBAC](/docs/guides/mariadb/custom-rbac/using-custom-rbac).
- Use [private Docker registry](/docs/guides/mariadb/private-registry/quickstart) to deploy MySQL with KubeDB.
- Initialize [MariaDB with Script](/docs/guides/mariadb/initialization/using-script).
- Backup and Restore [MariaDB](/docs/guides/mariadb/backup/overview).
- Backup and Restore [MariaDB](/docs/guides/mariadb/backup/stash/overview).
- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md).
10 changes: 10 additions & 0 deletions docs/guides/mariadb/backup/kubestash/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Backup & Restore MariaDB | KubeStash
menu:
docs_{{ .version }}:
identifier: guides-mariadb-backup-stashv2
name: KubeStash (aka Stash 2.0)
parent: guides-mariadb-backup
weight: 60
menu_name: docs_{{ .version }}
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: core.kubestash.com/v1alpha1
kind: BackupConfiguration
metadata:
name: sample-mariadb-backup
namespace: demo
spec:
target:
apiGroup: kubedb.com
kind: MariaDB
namespace: demo
name: sample-mariadb
backends:
- name: gcs-backend
storageRef:
namespace: demo
name: gcs-storage
retentionPolicy:
name: demo-retention
namespace: demo
sessions:
- name: frequent-backup
scheduler:
schedule: "*/5 * * * *"
jobTemplate:
backoffLimit: 1
repositories:
- name: gcs-mariadb-repo
backend: gcs-backend
directory: /mariadb
encryptionSecret:
name: encrypt-secret
namespace: demo
addon:
name: mariadb-addon
tasks:
- name: manifest-backup
- name: logical-backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: gcs-storage
namespace: demo
spec:
storage:
provider: gcs
gcs:
bucket: kubestash-qa
prefix: demo
secretName: gcs-secret
usagePolicy:
allowedNamespaces:
from: All
default: true
deletionPolicy: Delete
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: core.kubestash.com/v1alpha1
kind: RestoreSession
metadata:
name: restore-sample-mariadb
namespace: demo
spec:
manifestOptions:
mariaDB:
db: true
restoreNamespace: dev
dataSource:
repository: gcs-mariadb-repo
snapshot: latest
encryptionSecret:
name: encrypt-secret
namespace: demo
addon:
name: mariadb-addon
tasks:
- name: logical-backup-restore
- name: manifest-restore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: storage.kubestash.com/v1alpha1
kind: RetentionPolicy
metadata:
name: demo-retention
namespace: demo
spec:
default: true
failedSnapshots:
last: 2
maxRetentionPeriod: 2mo
successfulSnapshots:
last: 5
usagePolicy:
allowedNamespaces:
from: All
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: kubedb.com/v1
kind: MariaDB
metadata:
name: sample-mariadb
namespace: demo
spec:
version: 11.1.3
replicas: 3
storageType: Durable
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
deletionPolicy: WipeOut
Loading

0 comments on commit d7f7094

Please sign in to comment.