Skip to content

Commit 04fd8bb

Browse files
authored
Merge pull request #777 from rackerlabs/restore-docs-20250318-1
docs: Adds operator docs on restoring mariadb-operator backups
2 parents 17c70f4 + d0cdde3 commit 04fd8bb

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/operator-guide/mariadb-operator.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,45 @@ ROOTPASSWORD=$(kubectl get secret -n openstack mariadb -o json | jq -r '.data["r
3939
# perform the db dump
4040
/usr/local/opt/mariadb/bin/mariadb-dump -h 127.0.0.1 --skip-ssl -u root --password=$ROOTPASSWORD $DB_TO_DUMP | gzip > $DB_TO_DUMP.sql.gz
4141
```
42+
43+
## Restore from a point in time backup
44+
45+
This assumes you have backups enabled with regularly scheduled backups: <https://github.com/mariadb-operator/mariadb-operator/blob/main/docs/BACKUP.md/#scheduling>
46+
47+
Create a manifest with a point in time to restore from:
48+
49+
``` yaml
50+
apiVersion: k8s.mariadb.com/v1alpha1
51+
kind: Restore
52+
metadata:
53+
name: restore
54+
spec:
55+
mariaDbRef:
56+
name: mariadb
57+
backupRef:
58+
name: backup
59+
targetRecoveryTime: 2025-03-13T09:00:00Z
60+
```
61+
62+
Apply the manifest:
63+
64+
``` text
65+
 kubectl apply -f restore-time.yaml
66+
restore.k8s.mariadb.com/restore created
67+
```
68+
69+
Check the status:
70+
71+
``` text
72+
 kubectl get restore
73+
NAME COMPLETE STATUS MARIADB AGE
74+
restore False Running mariadb 4s
75+
```
76+
77+
Watch the restore logs:
78+
79+
``` text
80+
 kubectl logs -f restore-jtd9x
81+
Defaulted container "mariadb" out of: mariadb, mariadb-operator (init)
82+
💾 Restoring backup: /backup/backup.2025-03-13T09:00:05Z.sql
83+
```

0 commit comments

Comments
 (0)