PostgresBackup Synopsis

apiVersion: sql.tanzu.vmware.com/v1
kind: PostgresBackup
metadata:
  name: backup-sample
spec:
  sourceInstance:
    name: postgres-sample
  type: full

The sections below explain the properties that can be set for the PostgresBackup resource.

Metadata

name

Type: String
Required
Default: n/a
The name of the PostgresBackup. Must be unique within a namespace.
Example:
backup-sample

Spec

The spec describes the desired state for the Postgres backup object.

sourceInstance

Type: Object
Required
Default: n/a
The fields that describe the Postgres instance backup are name and type:

  • name
    Type: String
    Required
    Default: n/a
    The name of the Postgres instance on which you want to perform the on-demand backup.
    Example
    my-postgres-sample

  • type
    Type: String
    Optional
    Default: full
    The type of the Postgres Backup you want to take. The possible values full, incremental, or differential.
    Example
    incremental

expire

Type: Boolean
Optional
Default: false
The field determines if the backup will expire.
Example:
true

Status

The status fields show the observed status of the PostgresBackup object and these fields are populated by the controller that processes backups.

phase

Type: string
This field reflects the current state of the PostgresBackup resource. It can be empty or have the following values: Running, Failed, or Succeeded.

restoreLabel

Type: string
This field denotes the backup label. For example 20220306-155026F_20220306-155048F. Backup labels for full backups end with F, differential backups end with D, and incremental backups end with I.

timeStarted

Type: time
This field denotes the time when the backup started.

timeCompleted

Type: time
This field indicates the time when the backup completed. This field is populated once the PostgresBackup CR reaches Failed or Succeeded state. It is empty when the backup is running.

backupLocation

Type: string
This field contains the name of the backupLocation that's configured on the instance for which this backup is being taken.

dbName

Type: string
This field denotes the database name associated with the instance. It is same as the instance's spec.PgConfig.Dbname

size

Type: string
This field shows the size of the successful backup. The backups are measured in B, KB, MB, GB or TB.

stanzaName

Type: string
This field shows the backup stanza name of the instance for which the backup was taken. It has the format of - -

conditions

Type: Object
This field shows the current state of the PostgresBackup resource. It is useful for debugging. If the backup fails, this field would show the failure and the corresponding error message. For example:

Conditions:
    Last Transition Time:  2022-03-21T21:33:14Z
    Message:               pgbackrest failed with error: WARN: environment contains invalid option 'config-version'ERROR: [050]: unable to acquire lock on file '/tmp/pgbackrest/default-postgres-sample2-backup.lock': Resource temporarily unavailable       HINT: is another pgBackRest process running?
    Reason:                PgbackrestFailure
    Status:                True
    Type:                  BackupFailed
check-circle-line exclamation-circle-line close-line
Scroll to top icon