Skip to content

Commit

Permalink
docs: OSPC-367 improve operator restore info (#565)
Browse files Browse the repository at this point in the history
* docs: OSPC-367 Expand on operator restore opts

The operator supports restoring a single database. That is a useful
feature worth noting in our own docs for those preferring to use the
operator versus manually dumping and restoring.

* docs: OSPC-367 Demo checking restore status

* docs: OSPC-367 Move operator tips toward the top
  • Loading branch information
LukeRepko authored Nov 15, 2024
1 parent fa87c01 commit 588296e
Showing 1 changed file with 44 additions and 5 deletions.
49 changes: 44 additions & 5 deletions docs/infrastructure-mariadb-ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,40 @@ dump to your MariaDB database.
Refer to the mariadb-operator [restore documentation](https://github.com/mariadb-operator/mariadb-operator/blob/main/docs/BACKUP.md#restore)
for more information.

!!! tip "Operator Restore Tips"

1. If you have multiple backups available, the operator is able to infer
which backup to restore based on the `spec.targetRecoveryTime` field
discussed in the operator documentation [here](https://github.com/mariadb-operator/mariadb-operator/blob/main/docs/BACKUP.md#target-recovery-time).
2. The referred database (db1 in the example below) must previously exist
for the Restore to succeed.
3. The mariadb CLI invoked by the operator under the hood only supports
selecting a single database to restore via the `--one-database` option,
restoration of multiple specific databases is not supported.

### Restore All Databases

!!! danger "The following command may lead to data loss"

``` shell
cat <<EOF | kubectl -n openstack apply -f -
apiVersion: k8s.mariadb.com/v1alpha1
kind: Restore
metadata:
name: maria-restore
spec:
mariaDbRef:
name: mariadb-cluster
backupRef:
name: mariadb-backup
EOF
```

### Restore Single Database

!!! danger "The following command may lead to data loss"

```shell
``` shell
cat <<EOF | kubectl -n openstack apply -f -
apiVersion: k8s.mariadb.com/v1alpha1
kind: Restore
Expand All @@ -100,11 +131,19 @@ for more information.
name: mariadb-cluster
backupRef:
name: mariadb-backup
databases: db1
EOF
```

!!! tip
### Check Restore Progress

!!! success "Simply _get_ the restore object previously created"

``` shell
kubectl -n openstack get restore maria-restore
```

If you have multiple backups available, the operator is able to infer which
backup to restore based on the `spec.targetRecoveryTime` field discussed
in the operator documentation [here](https://github.com/mariadb-operator/mariadb-operator/blob/main/docs/BACKUP.md#target-recovery-time).
``` { .no-copy }
NAME COMPLETE STATUS MARIADB AGE
maria-restore True Success mariadb-cluster 26s
```

0 comments on commit 588296e

Please sign in to comment.