Kind: SGBackupConfig
listKind: SGBackupConfigList
plural: sgbackupconfigs
singular: sgbackupconfig
shortNames sgbac
WARNING: This CRD has been deprecated and is replaced by the SGObjectStorage CRD that have to be specified by the new section
.spec.configurations.backups
in the SGCluster CRD.
Backup configuration allows 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 SGBackupConfig
custom resource represents the backup configuration of a Postgres cluster.
Example:
apiVersion: stackgres.io/v1
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
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
apiVersion | ✓ | string | stackgres.io/v1 | ||
kind | ✓ | string | SGBackupConfig | ||
metadata | ✓ | ✓ | object | Refer to the Kubernetes API documentation for the fields of the metadata field. |
|
spec | ✓ | ✓ | object |
|
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
storage | ✓ | ✓ | object |
Backup storage configuration.
|
|
baseBackups | ✓ | object |
Back backups configuration.
|
Backup storage configuration.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
type | ✓ | ✓ | enum |
Determine the type of object storage used for storing the base backups and WAL segments.
Possible values:
|
|
azureBlob | ✓ | object |
Azure Blob Storage configuration.
|
||
gcs | ✓ | object |
Google Cloud Storage configuration.
|
||
s3 | ✓ | object |
Amazon Web Services S3 configuration.
|
||
s3Compatible | ✓ | object |
AWS S3-Compatible API configuration |
Azure Blob Storage configuration.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
azureCredentials | ✓ | ✓ | object |
The credentials to access Azure Blob Storage for writing and reading.
|
|
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 .
|
The credentials to access Azure Blob Storage for writing and reading.
Property |
Required |
Updatable |
May Require Restart |
Type |
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.
|
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.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
accessKey | ✓ | ✓ | object |
The storage account access key.
|
|
storageAccount | ✓ | ✓ | object |
The Storage Account that contains the Blob bucket to be used.
|
The storage account access key.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
key | ✓ | ✓ | string |
The key of the secret to select from. Must be a valid secret key.
|
|
name | ✓ | ✓ | string |
Name of the referent. More information.
|
The Storage Account that contains the Blob bucket to be used.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
key | ✓ | ✓ | string |
The key of the secret to select from. Must be a valid secret key.
|
|
name | ✓ | ✓ | string |
Name of the referent. More information.
|
Google Cloud Storage configuration.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
bucket | ✓ | ✓ | string |
GCS bucket name.
|
|
gcpCredentials | ✓ | ✓ | object |
The credentials to access GCS for writing and reading.
|
|
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 .
|
The credentials to access GCS for writing and reading.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
fetchCredentialsFromMetadataService | ✓ | boolean |
If true, the credentials will be fetched from the GCE/GKE metadata service and the field secretKeySelectors have to be set to null or omitted.
This is useful when running StackGres inside a GKE cluster using Workload Identity.
|
||
secretKeySelectors | ✓ | object |
A Kubernetes SecretKeySelector to reference the Secrets that contain the information about the Service Account to access GCS.
|
A Kubernetes SecretKeySelector to reference the Secrets that contain the information about the Service Account to access GCS.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
serviceAccountJSON | ✓ | ✓ | object |
A service account key from GCP. In JSON format, as downloaded from the GCP Console.
|
A service account key from GCP. In JSON format, as downloaded from the GCP Console.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
key | ✓ | ✓ | string |
The key of the secret to select from. Must be a valid secret key.
|
|
name | ✓ | ✓ | string |
Name of the referent. More information.
|
Amazon Web Services S3 configuration.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
awsCredentials | ✓ | ✓ | object |
The credentials to access AWS S3 for writing and reading.
|
|
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 .
|
||
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 .
|
The credentials to access AWS S3 for writing and reading.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
secretKeySelectors | ✓ | ✓ | object |
Kubernetes SecretKeySelector(s) to reference the Secrets 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.
|
Kubernetes SecretKeySelector(s) to reference the Secrets 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.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
accessKeyId | ✓ | ✓ | object |
AWS access key ID. For example, AKIAIOSFODNN7EXAMPLE .
|
|
secretAccessKey | ✓ | ✓ | object |
AWS secret access key. For example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY .
|
AWS access key ID. For example, AKIAIOSFODNN7EXAMPLE
.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
key | ✓ | ✓ | string |
The key of the secret to select from. Must be a valid secret key.
|
|
name | ✓ | ✓ | string |
Name of the referent. More information.
|
AWS secret access key. For example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
key | ✓ | ✓ | string |
The key of the secret to select from. Must be a valid secret key.
|
|
name | ✓ | ✓ | string |
Name of the referent. More information.
|
AWS S3-Compatible API configuration
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
awsCredentials | ✓ | ✓ | object |
The credentials to access AWS S3 for writing and reading.
|
|
bucket | ✓ | ✓ | string |
Bucket name.
|
|
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.
|
||
endpoint | ✓ | string |
Overrides the default url to connect to an S3-compatible service.
For example: http://s3-like-service:9000 .
|
||
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 .
|
||
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 .
|
The credentials to access AWS S3 for writing and reading.
Property |
Required |
Updatable |
May Require Restart |
Type |
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.
|
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.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
accessKeyId | ✓ | ✓ | object |
AWS access key ID. For example, AKIAIOSFODNN7EXAMPLE .
|
|
secretAccessKey | ✓ | ✓ | object |
AWS secret access key. For example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY .
|
AWS access key ID. For example, AKIAIOSFODNN7EXAMPLE
.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
key | ✓ | ✓ | string |
The key of the secret to select from. Must be a valid secret key.
|
|
name | ✓ | ✓ | string |
Name of the referent. More information.
|
AWS secret access key. For example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
key | ✓ | ✓ | string |
The key of the secret to select from. Must be a valid secret key.
|
|
name | ✓ | ✓ | string |
Name of the referent. More information.
|
Back backups configuration.
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
compression | ✓ | enum |
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.
Enum: lz4, lzma, brotli |
||
cronSchedule | ✓ | string |
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 (
Also ranges of values ( If not set, full backups are performed everyday at 05:00 UTC.
|
||
performance | ✓ | object |
|
||
retention | ✓ | integer |
Define the number of backups with managed lifecycle to keep, in a sliding window.
Consequently, the time range covered by backups is WAL files before the oldest backup with managed lifecycle will also be removed. So that, when retention is applied, the oldest WAL available will be Default is 5.
|
Property |
Required |
Updatable |
May Require Restart |
Type |
Description |
---|---|---|---|---|---|
maxDiskBandwidth | ✓ | integer |
Maximum disk read I/O when performing a backup. In bytes (per second).
|
||
maxDiskBandwitdh | ✓ | integer |
Deprecated: use instead maxDiskBandwidth.
Maximum disk read I/O when performing a backup. In bytes (per second).
|
||
maxNetworkBandwidth | ✓ | integer |
Maximum storage upload bandwidth used when storing a backup. In bytes (per second).
|
||
maxNetworkBandwitdh | ✓ | integer |
Deprecated: use instead maxNetworkBandwidth.
Maximum storage upload bandwidth used when storing a backup. In bytes (per second).
|
||
uploadDiskConcurrency | ✓ | integer |
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).
Minimum: 1 |