apiVersion: sql.tanzu.vmware.com/v1
kind: PostgresRestore
metadata:
name: restore-sample
spec:
sourceBackup:
name: backup-sample
targetInstance:
name: postgres-sample
# pitr:
# type: <latest|time|lsn|transaction>
# target: <lsn-value|transaction-id-value>
# timestamp: <timestamp-value>
# bestEffort: <true|false>
# sourceBackupLocation:
# name: <backup-location-name>
# stanzaName: <sample-stanza-name>
# set: <backup-restore-label>
The list below explains the properties that can be set for the PostgresRestore resource.
Type: String
Required
Default: n/a
The name of the PostgresRestore. Must be unique within a namespace.
Example:
restore-sample
The spec describes the desired state for the Postgres backup object.
Type: Object
Optional
Default: n/a
backup-sample
Type: Object
Required
Default: n/a
my-target-instance
Type: string
Optional
Default: n/a
This field has been deprecated in favor of spec.pitr.type
with the value set to time
.
Type: Object
Optional
Default: n/a
type
Type: String
Required
Default: n/a
The type of recovery you want to perform. The possible values are latest
, timestamp
, lsn
and transaction
.
Example
latest
target
Type: String
Optional
Default: n/a
This field is only supported when the value of spec.pitr.type
is set to lsn
or transaction
. It specifies the target lsn or transaction id for the restore.
Example
0/4000060
or 791
timestamp
Type: String
Optional
Default: n/a
This field is only supported when the value of spec.pitr.type
is set to time
. It specifies the desired time to use as a restore target.
Example
2022-05-26T18:30:00-04:00
bestEffort
Type: Boolean
Optional
Default: false
This field is only supported when the value of spec.pitr.type
is set to time
. When set to true
, it specifies that Postgres should restore to the latest write-ahead-log (WAL) record if an invalid recovery time is provided.
Example
false
sourceBackupLocation
Type: Object
Required
Default: n/a
Specifies the backup location that contains the backups to clone from. Example
sourceBackupLocation:
name: my-backup-location
stanzaName: prod-instance-012345abcd
set:
name
Type: String
Required
Default: n/a
Specifies the name of a backup location.
stanzaName
Type: String
Required
Default: n/a
Specifies the name of a stanza within the location.
set
Type: String
Optional
Default: n/a
Is an optional field that specifies a Pgbackrest backup to use for restore.
When used, set
should be the backup that was a taken before the desired restore point.
Example
20230622-114327F
The status fields show the observed status of the PostgresRestore object and the values are updated by the controller that handles Backup/Restore in the instance.
Type: string
This field shows the current state of a PostgresRestore CR. It can be either empty or have any of the following values:
Failed
or Succeeded
.Type: time
This field denotes the time when the restore started
Type: time
This field indicates the time when the restore got completed. This field is populated once the PostgresRestore CR reaches Failed
or Succeeded
state.
Type: time
This field shows some error/useful messages for why a restore is stuck or pending.
Example:
Instance postgres-sample does not specify spec.backupLocation.name
Type: Object
This field shows the state of the PostgresRestore resource.
Example:
conditions:
- lastTransitionTime: "2023-06-28T15:34:18Z"
message: Postgres was unable to reach '2023-06-28 16:32:43+00'. Restoring to the
last completed transaction at '2023-06-28 15:31:44.855676+00'.
reason: ResetRecoveryConfigSuccessful
status: "True"
type: BestEffortRecoveryApplied