Skip to content

Commit b3f4b20

Browse files
committed
noobaa DB backup - design doc and API changes
Signed-off-by: Danny Zaken <[email protected]>
1 parent 5510db0 commit b3f4b20

File tree

6 files changed

+792
-2
lines changed

6 files changed

+792
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ build-releases/
1515
# NooBaa config file
1616
noobaa.cfg.yaml
1717

18+
# ignore any DS_Store file created by macos
19+
.DS_Store
20+
1821
*.IGNORE

deploy/crds/noobaa.io_noobaas.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,40 @@ spec:
12031203
dbSpec:
12041204
description: DBSpec (optional) DB spec for a managed postgres cluster
12051205
properties:
1206+
dbBackup:
1207+
description: |-
1208+
DBBackup (optional) configure automatic scheduled backups of the database volume.
1209+
Currently, only volume snapshots are supported.
1210+
properties:
1211+
schedule:
1212+
description: Schedule the schedule for the database backup
1213+
in cron format.
1214+
pattern: ^(@(annually|yearly|monthly|weekly|daily|hourly))|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*)
1215+
?){5,7})$
1216+
type: string
1217+
volumeSnapshot:
1218+
description: |-
1219+
VolumeSnapshot the volume snapshot backup configuration.
1220+
Currntly this is the only supported backup method and hence it is required.
1221+
properties:
1222+
maxSnapshots:
1223+
description: MaxSnapshots the maximum number of snapshots
1224+
to keep.
1225+
minimum: 1
1226+
type: integer
1227+
volumeSnapshotClass:
1228+
description: VolumeSnapshotClass the volume snapshot class
1229+
for the database volume.
1230+
minLength: 1
1231+
type: string
1232+
required:
1233+
- maxSnapshots
1234+
- volumeSnapshotClass
1235+
type: object
1236+
required:
1237+
- schedule
1238+
- volumeSnapshot
1239+
type: object
12061240
dbConf:
12071241
additionalProperties:
12081242
type: string
@@ -1215,6 +1249,18 @@ spec:
12151249
Increasing the size of the volume is supported if the underlying storage class supports volume expansion.
12161250
The new size should be larger than actualVolumeSize in dbStatus for the volume to be resized.
12171251
type: string
1252+
dbRecovery:
1253+
description: DBRecovery (optional) configure database recovery
1254+
from snapshot
1255+
properties:
1256+
volumeSnapshotName:
1257+
description: VolumeSnapshotName specifies the name of the
1258+
volume snapshot to recover from
1259+
minLength: 1
1260+
type: string
1261+
required:
1262+
- volumeSnapshotName
1263+
type: object
12181264
dbResources:
12191265
description: DBResources (optional) overrides the default resource
12201266
requirements for the db container
@@ -1982,6 +2028,29 @@ spec:
19822028
description: ActualVolumeSize is the actual size of the postgres
19832029
cluster volume. This can be different than the requested size
19842030
type: string
2031+
backupStatus:
2032+
description: BackupStatus reports the status of database backups
2033+
properties:
2034+
availableSnapshots:
2035+
description: AvailableSnapshots list of available snapshot
2036+
names
2037+
items:
2038+
type: string
2039+
type: array
2040+
lastBackupTime:
2041+
description: LastBackupTime timestamp of the last successful
2042+
backup
2043+
format: date-time
2044+
type: string
2045+
nextBackupTime:
2046+
description: NextBackupTime timestamp of the next scheduled
2047+
backup
2048+
format: date-time
2049+
type: string
2050+
totalSnapshots:
2051+
description: TotalSnapshots current number of snapshots
2052+
type: integer
2053+
type: object
19852054
currentPgMajorVersion:
19862055
description: CurrentPgMajorVersion is the major version of the
19872056
postgres cluster
@@ -1992,6 +2061,21 @@ spec:
19922061
dbCurrentImage:
19932062
description: DBCurrentImage is the image of the postgres cluster
19942063
type: string
2064+
recoveryStatus:
2065+
description: RecoveryStatus reports the status of database recovery
2066+
properties:
2067+
recoveryTime:
2068+
description: RecoveryTime timestamp when recovery was initiated
2069+
format: date-time
2070+
type: string
2071+
snapshotName:
2072+
description: SnapshotName name of the snapshot being recovered
2073+
from
2074+
type: string
2075+
status:
2076+
description: Status current recovery status
2077+
type: string
2078+
type: object
19952079
type: object
19962080
endpoints:
19972081
description: |-

0 commit comments

Comments
 (0)