SGBackupConfig

Configuration

Backup configuration allow to specify when and how backups are performed. By default this is done at 5am UTC in a window of 1 hour, you may change this value in order to perform backups for another time zone and period of time. The backup configuration CR represent the backups configuration of the cluster.


Kind: SGBackupConfig

listKind: SGBackupConfigList

plural: sgbackupconfigs

singular: sgbackupconfig


Spec

Property Required Updatable Type Default Description
baseBackups object
Back backups configuration.
storage object
Backup storage configuration.

Example:

apiVersion: stackgres.io/v1beta1
kind: SGBackupConfig
metadata:
  name: backupconf
spec:
  baseBackups:
    retention: 5
    cronSchedule: 0 5 * * *
    compression: lz4
    performance:
      maxDiskBandwitdh: 26214400 #25 MB per seceod
      maxNetworkBandwitdh: 52428800 #50 MB per second
      uploadDiskConcurrency: 2
  storage:
    type: s3Compatible
    s3Compatible:
      bucket: stackgres
      region: k8s
      enablePathStyleAddressing: true
      endpoint: http://my-cluster-minio:9000
      awsCredentials:
        secretKeySelectors:
          accessKeyId:
            key: accesskey
            name: my-cluster-minio
          secretAccessKey:
            key: secretkey
            name: my-cluster-minio

Base Backups

Property Required Updatable Type Default Description
retention integer 5

When an automatic retention policy is defined to delete old base backups, this parameter specifies the number of base backups to keep, in a sliding window.

Consequently, the time range covered by backups is periodicity*retention, where periodicity is the separation between backups as specified by the cronSchedule property.

Default is 5.

cronSchedule string 05:00 UTC

Continuous Archiving backups are composed of periodic base backups and all the WAL segments produced in between those base backups. This parameter specifies at what time and with what frequency to start performing a new base backup.

Use cron syntax (m h dom mon dow) for this parameter, i.e., 5 values separated by spaces:

  • m: minute, 0 to 59.
  • h: hour, 0 to 23.
  • dom: day of month, 1 to 31 (recommended not to set it higher than 28).
  • mon: month, 1 to 12.
  • dow: day of week, 0 to 7 (0 and 7 both represent Sunday).

Also ranges of values (start-end), the symbol * (meaning first-last) or even */N, where N is a number, meaning ““every N, may be used. All times are UTC. It is recommended to avoid 00:00 as base backup time, to avoid overlapping with any other external operations happening at this time.

If not set, full backups are performed each day at 05:00 UTC.

compression string lz4
Specifies the backup compression algorithm. Possible options are: lz4, lzma, brotli. The default method is lz4. LZ4 is the fastest method, but compression ratio is the worst. LZMA is way slower, but it compresses backups about 6 times better than LZ4. Brotli is a good trade-off between speed and compression ratio, being about 3 times better than LZ4.
performance object

Base Backup Performance

Property Required Updatable Type Default Description
maxDiskBandwitdh integer unlimited
Maximum disk read I/O when performing a backup. In bytes (per second).
maxNetworkBandwitdh integer unlimited
Maximum storage upload bandwidth used when storing a backup. In bytes (per second).
uploadDiskConcurrency integer 1
Backup storage may use several concurrent streams to store the data. This parameter configures the number of parallel streams to use. By default, it’s set to 1 (use one stream).

Storage Configuration

Property Required Updatable Type Default Description
type string

Determine the type of object storage used for storing the base backups and WAL segments. Possible values:

  • s3: Amazon Web Services S3 (Simple Storage Service).
  • s3Compatible: non-AWS services that implement a compatibility API with AWS S3.
  • gcs: Google Cloud Storage.
  • azureBlob: Microsoft Azure Blob Storage.
s3 if type = s3 object
Amazon Web Services S3 configuration.
s3Compatible if type = s3Compatible object
AWS S3-Compatible API configuration
gcs if type = gcs object
Google Cloud Storage configuration.
azureBlob if type = azureblob object
Azure Blob Storage configuration.

S3

S3 - Amazon Web Services S3 configuration

Property Required Updatable Type Default Description
bucket string
AWS S3 bucket name.
path string
Optional path within the S3 bucket. Note that StackGres generates in any case a folder per StackGres cluster, using the SGCluster.metadata.name.
awsCredentials object
The credentials to access AWS S3 for writing and reading.
region string
The AWS S3 region. The Region may be detected using s3:GetBucketLocation, but if you wish to avoid giving permissions to this API call or forbid it from the applicable IAM policy, you must then specify this property.
storageClass string
The Amazon S3 Storage Class to use for the backup object storage. By default, the STANDARD storage class is used. Other supported values include STANDARD_IA for Infrequent Access and REDUCED_REDUNDANCY.

S3 - Amazon Web Services S3 Compatible configuration

Property Required Updatable Type Default Description
bucket string
Bucket name.
path string
Optional path within the S3 bucket. Note that StackGres generates in any case a folder per StackGres cluster, using the SGCluster.metadata.name.
awsCredentials object
The credentials to access AWS S3 for writing and reading.
region string
The AWS S3 region. The Region may be detected using s3:GetBucketLocation, but if you wish to avoid giving permissions to this API call or forbid it from the applicable IAM policy, you must then specify this property.
storageClass string
The Amazon S3 Storage Class to use for the backup object storage. By default, the STANDARD storage class is used. Other supported values include STANDARD_IA for Infrequent Access and REDUCED_REDUNDANCY.
endpoint string
Overrides the default url to connect to an S3-compatible service. For example: http://s3-like-service:9000.
enablePathStyleAddressing boolean

Enable path-style addressing (i.e. http://s3.amazonaws.com/BUCKET/KEY) when connecting to an S3-compatible service that lacks support for sub-domain style bucket URLs (i.e. http://BUCKET.s3.amazonaws.com/KEY).

Defaults to false.

Amazon Web Services Credentials

Property Required Updatable Type Default Description
secretKeySelectors object
Kubernetes SecretKeySelector(s) to reference the Secret(s) that contain the information about the awsCredentials. Note that you may use the same or different Secrets for the accessKeyId and the secretAccessKey. In the former case, the keys that identify each must be, obviously, different.

Amazon Web Services Secret Key Selector

Property Required Updatable Type Default Description
accessKeyId object
AWS access key ID. For example, AKIAIOSFODNN7EXAMPLE.
secretAccessKey object
AWS secret access key. For example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY.

GSC - Google Cloud Storage configuration

Property Required Updatable Type Default Description
bucket string
GCS bucket name.
path string
Optional path within the GCS bucket. Note that StackGres generates in any case a folder per StackGres cluster, using the SGCluster.metadata.name.
gcpCredentials object
The credentials to access GCS for writing and reading.

GCP Credentials

Property Required Updatable Type Default Description
secretKeySelectors object
A Kubernetes SecretKeySelector to reference the Secrets that contain the information about the Service Account to access GCS.

GCP Secret Key Selector

Property Required Updatable Type Default Description
serviceAccountJSON object
A service account key from GCP. In JSON format, as downloaded from the GCP Console.

AZURE - Azure Blob Storage configuration

Property Required Updatable Type Default Description
bucket string
Azure Blob Storage bucket name.
path string
Optional path within the Azure Blob bucket. Note that StackGres generates in any case a folder per StackGres cluster, using the SGCluster.metadata.name.
azureCredentials object
The credentials to access Azure Blob Storage for writing and reading.

Azure Credentials

Property Required Updatable Type Default Description
secretKeySelectors object
Kubernetes SecretKeySelector(s) to reference the Secret(s) that contain the information about the azureCredentials. . Note that you may use the same or different Secrets for the storageAccount and the accessKey. In the former case, the keys that identify each must be, obviously, different.

Azure Secret Key Selector

Property Required Updatable Type Default Description
storageAccount object
The Storage Account that contains the Blob bucket to be used.
accessKey object