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:
sgBackups:
- backup-coord
- backup-worker0
- backup-worker1
process:
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 worker 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 SGShardedCluster configured with an SGObjectStorage.
When an SGShardedBackup is created a Job will perform a full sharded backup of the database and update the status of the SGShardedBackup with 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 sharded backups (excluding WAL files) that do not belong to any SGBackup. If the target storage of the SGObjectStorage 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 belong to any SGBackup will not be performed anymore on the previous storage, only on the new target storage.
Property |
Description |
|---|---|
| apiVersion string |
stackgres.io/v1 Constraints: required, immutable |
| kind string |
SGShardedBackup Constraints: required, immutable |
| metadata object |
Refer to the Kubernetes API documentation for the fields of the metadata field.Constraints: required, updatable |
| spec object |
Constraints: required, updatable |
| status object |
Constraints: optional, updatable |
Property |
Description |
|---|---|
| managedLifecycle boolean |
Indicate if this sharded backup is permanent and should not be removed by the automated
retention policy. Default is
false.
Constraints: optional, updatable |
| maxRetries integer |
The maximum number of retries the backup operation is allowed to do after a failure.
A value of Constraints: optional, updatable |
| reconciliationTimeout integer |
Allow to set a timeout for the reconciliation process that takes 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 scheduled backup Job takes place.
Constraints: optional, updatable Default: 300 |
| retryDelay string |
An ISO 8601 duration in the format
PnDTnHnMn.nS, that specifies the initial delay used by the exponential backoff applied when a command run by the backup script is retried and in general by unbounded retries and in some cases without exponential backoff.
Defaults to: Constraints: optional, updatable |
| retryLimit integer |
The maximum number of times a command run by the backup script is retried before failing.
Defaults to: Constraints: optional, updatable |
| retryMaxDelay string |
An ISO 8601 duration in the format
PnDTnHnMn.nS, that specifies the maximum delay the exponential backoff is allowed to reach when a command run by the backup script is retried.
Defaults to: Constraints: optional, updatable |
| 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 Constraints: optional, updatable |
| 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 fails. If set to 0 is the same as not being set. Make sure to set a reasonably high value in order to allow for any unexpected delays during backup creation (network low bandwidth, disk low throughput and so forth).
Constraints: optional, updatable |
Property |
Description |
|---|---|
| backupInformation object |
Constraints: optional, updatable |
| process object |
Constraints: optional, updatable |
| sgBackups []string |
The list of SGBackups that compose the SGShardedBackup used to restore the sharded cluster.
Constraints: optional, updatable |
Property |
Description |
|---|---|
| postgresVersion string |
Postgres version of the server where the sharded backup is taken from.
Constraints: optional, updatable |
| size object |
Constraints: optional, updatable |
Property |
Description |
|---|---|
| compressed integer |
Size (in bytes) of the compressed sharded backup.
Constraints: optional, updatable Format: int64 |
| uncompressed integer |
Size (in bytes) of the uncompressed sharded backup.
Constraints: optional, updatable Format: int64 |
Property |
Description |
|---|---|
| failure string |
If the status is
failed this field will contain a message indicating the failure reason.
Constraints: optional, updatable |
| 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.
Constraints: optional, updatable |
| status string |
Status of the sharded backup.
Constraints: optional, updatable |
| timing object |
Constraints: optional, updatable |
Property |
Description |
|---|---|
| end string |
End time of sharded backup.
Constraints: optional, updatable |
| start string |
Start time of sharded backup.
Constraints: optional, updatable |
| stored string |
Time at which the sharded backup is safely stored in the object storage.
Constraints: optional, updatable |