SGShardedBackup


Kind: SGShardedBackup

listKind: SGShardedBackupList

plural: sgbackups

singular: sgbackup

shortNames sgbkp


The SGShardedBackup custom resource represents a backup of the sharded Postgres cluster. Backups are created automatically by a cron job configured using the settings in the backup configuration or manually by creating a SGShardedBackup.

Example:

apiVersion: stackgres.io/v1
kind: SGShardedBackup
metadata:
  name: backup
spec:
  sgShardedCluster: stackgres
  managedLifecycle: true
status:
  process:
    sgBackups:
    - backup-coord
    - backup-shard0
    - backup-shard1
    status: Completed
    jobPod: backup-backup-q79zq
    timing:
      start: "2020-01-22T10:17:24.983902Z"
      stored: "2020-01-22T10:17:27.183Z"
      end: "2020-01-22T10:17:27.165204Z"
  backupInformation:
    postgresVersion: "11.6"
    size:
      compressed: 6691164
      uncompressed: 24037844

See also Backups section.

The SGShardedBackup represents a manual or automatically generated sharded backup of an SGShardedCluster configured with an SGObjectStorage.

When a SGShardedBackup is created a Job will perform a full backup for the coordinator and each shard that will be stored in a SGBackup and will update the status of the SGShardedBackup with the all the information required to restore it and some stats (or a failure message in case something unexpected happened). After an SGShardedBackup is created the same Job performs a reconciliation of the sharded backups by applying the retention window that has been configured in the SGObjectStorage and removing the sharded backups with managed lifecycle and the WAL files older than the ones that fit in the retention window. The reconciliation also removes backups (excluding WAL files) that do not belongs to any SGShardedBackup. If the target storage of the SGObjectStorage is changed deletion of an SGShardedBackup backups with managed lifecycle and the WAL files older than the ones that fit in the retention window and of backups that do not belongs to any SGShardedBackup will not be performed anymore on the previous storage, only on the new target storage.

A manual or automatically generated sharded backup of an SGCluster configured with an SGBackupConfig.

When a SGBackup is created a Job will perform a full sharded backup of the database and update the status of the SGBackup with the all the information required to restore it and some stats (or a failure message in case something unexpected happened). After an SGBackup is created the same Job performs a reconciliation of the sharded backups by applying the retention window that has been configured in the SGBackupConfig and removing the sharded backups with managed lifecycle and the WAL files older than the ones that fit in the retention window. The reconciliation also removes sharded backups (excluding WAL files) that do not belongs to any SGBackup. If the target storage of the SGBackupConfig is changed deletion of an SGBackup sharded backups with managed lifecycle and the WAL files older than the ones that fit in the retention window and of sharded backups that do not belongs to any SGBackup will not be performed anymore on the previous storage, only on the new target storage.

Property
Required
Updatable
May Require Restart
Type
Description

Workaround for hugo bug not rendering first table row

apiVersion string stackgres.io/v1
kind string SGShardedBackup
metadata object Refer to the Kubernetes API documentation for the fields of the metadata field.
spec object
status object

SGShardedBackup.spec

↩ Parent

Property
Required
Updatable
May Require Restart
Type
Description

Workaround for hugo bug not rendering first table row

managedLifecycle boolean Indicate if this sharded backup is permanent and should not be removed by the automated retention policy. Default is false.
maxRetries integer The maximum number of retries the backup operation is allowed to do after a failure.

A value of 0 (zero) means no retries are made. Defaults to: 3.

reconciliationTimeout integer Allow to set a timeout for the reconciliation process that take place after the backup.

If not set defaults to 300 (5 minutes). If set to 0 it will disable timeout.

Failure of reconciliation will not make the backup fail and will be re-tried the next time a SGBackup or shecduled backup Job take place.

Default: 300

sgShardedCluster string The name of the SGShardedCluster from which this sharded backup is/will be taken.

If this is a copy of an existing completed sharded backup in a different namespace the value must be prefixed with the namespace of the source backup and a dot . (e.g. <sharded cluster namespace>.<sharded cluster name>) or have the same value if the source sharded backup is also a copy.

timeout integer Allow to set a timeout for the backup creation.

If not set it will be disabled and the backup operation will continue until the backup completes or fail. If set to 0 is the same as not being set.

Make sure to set a reasonable high value in order to allow for any unexpected delays during backup creation (network low bandwidth, disk low throughput and so forth).

SGShardedBackup.status

↩ Parent

Property
Required
Updatable
May Require Restart
Type
Description

Workaround for hugo bug not rendering first table row

backupInformation object
process object
sgBackups []string The list of SGBackups that compose the SGShardedBackup used to restore the sharded cluster.

SGShardedBackup.status.backupInformation

↩ Parent

Property
Required
Updatable
May Require Restart
Type
Description

Workaround for hugo bug not rendering first table row

postgresVersion string Postgres version of the server where the sharded backup is taken from.
size object

SGShardedBackup.status.backupInformation.size

↩ Parent

Property
Required
Updatable
May Require Restart
Type
Description

Workaround for hugo bug not rendering first table row

compressed integer Size (in bytes) of the compressed sharded backup.

Format: int64
uncompressed integer Size (in bytes) of the uncompressed sharded backup.

Format: int64

SGShardedBackup.status.process

↩ Parent

Property
Required
Updatable
May Require Restart
Type
Description

Workaround for hugo bug not rendering first table row

failure string If the status is failed this field will contain a message indicating the failure reason.
jobPod string Name of the pod assigned to the sharded backup. StackGres utilizes internally a locking mechanism based on the pod name of the job that creates the sharded backup.
status string Status of the sharded backup.
timing object

SGShardedBackup.status.process.timing

↩ Parent

Property
Required
Updatable
May Require Restart
Type
Description

Workaround for hugo bug not rendering first table row

end string End time of sharded backup.
start string Start time of sharded backup.
stored string Time at which the sharded backup is safely stored in the object storage.