Backups
On this page
Note
Operator 1.backup-s3-endpoint
and backup-compatibility-mode
.
-
Upgrading to Operator 1.
2. 1, which contains these parameters -
Using CR spec
backupSpec.
ands3Endpoint backupSpec.
to specify their valuescompatibilityMode
Backup Configurations
As of Operator 1.sdb-operator.
file can be configured so that the Operator will manage and perform backups.
-
backup-bucket-name
: The AWS S3 bucket, including the path if desired -
backup-default-schedule
: Default schedule for backup databases, incron
format.See below for more information. If backup-incremental-default-schedule
is specified, the scheduled job will perform a backup usingBACKUP DATABASE .
, otherwise, it will perform a plain. . WITH INIT . . . BACKUP DATABASE
without using theWITH INIT
option. -
backup-s3-endpoint
: Provide compatible AWS S3 endpoint URL, otherwise leave blank (optional) -
backup-s3-region
: Name of the AWS S3 region (optional) -
backup-secret-name
: Name of the AWS Secret for the S3 backup
As of Operator 1.sdb-operator.
file may also include:
-
backup-compatibility-mode
: Disables certain optimizations that only work with native S3, the primary use case for which is backing up to GCS (optional) Refer to BACKUP DATABASE for more information.
As of Operator 1.sdb-operator.
file may also include:
-
backup-incremental-default-schedule
: Default schedule for databases incremental backup, incron
format.If this is configured, it will perform an incremental backup using BACKUP DATABASE .
option if there is already a backup created by using. . WITH DIFFERENTIAL . . . WITH INIT
option, otherwise the first time the incremental backup is run, it will perform a backup usingWITH INIT
option.See below for more information. -
backup-default-deadline-seconds
: Default deadline in seconds that the backup job has to finish before it is terminated.Defaults to 3600 seconds
if not specified. -
backup-incremental-default-deadline-seconds
: Default deadline in seconds that the incremental backup job has to finish before it is terminated.Defaults to 3600
seconds if not specified.It’s suggested to make this value the same value as backup-default-deadline-seconds
.
As of Operator 1.backupSpec
in the CR, which includes the following fields.sdb-operator.
file.backupSpec
in the CR takes precedence over the parameter specified in sdb-operator.
file.
-
bucketName:
-
s3Region:
-
s3Endpoint:
-
secretName:
-
schedule:
-
deadlineSeconds:
-
scheduleIncremental:
-
deadlineSecondsIncremental:
-
compatibilityMode:
You may define the --backup-default-schedule
and/or backup-incremental-default-schedule
using the following cron
job scheduling format:
Unit |
Description |
Value |
---|---|---|
|
Minute field |
0 to 59 |
|
Hour field |
0 to 23 |
|
Day of Month |
1 to 31 |
|
Month field |
1 to 12 |
|
Day of Week |
0 to 6 |
For example:
+---------------- MIN| +------------- HOUR| | +---------- DOM| | | +------- MON| | | | +---- DOW| | | | |"--backup-default-schedule", "0 1 * * *",
The following is an example sdb-operator.
file that’s configured for backups using the parameters above:
apiVersion: apps/v1kind: Deploymentmetadata:name: sdb-operatorlabels:app.kubernetes.io/component: operatorspec:replicas: 1selector:matchLabels:name: sdb-operatortemplate:metadata:labels:name: sdb-operatorspec:serviceAccountName: sdb-operatorcontainers:- name: sdb-operatorimage: "singlestore/operator"imagePullPolicy: Neverargs: [# Cause the operator to merge rather than replace annotations on services"--merge-service-annotations",# Allow the process inside the container to have read/write access to the volume."--fs-group-id", "5555",# Configure operator to run backup daily at 1 AM"--backup-bucket-name", "<bucket-name/path>","--backup-default-schedule", "0 1 * * *","--backup-s3-endpoint", "","--backup-s3-region", "<AWS region for example us-west-1>","--backup-secret-name", "aws-credential"]env:- name: WATCH_NAMESPACEvalueFrom:fieldRef:fieldPath: metadata.namespace- name: POD_NAMEvalueFrom:fieldRef:fieldPath: metadata.name- name: OPERATOR_NAMEvalue: "sdb-operator"
The following is an example aws-secret.
file for using AWS S3 to store backups.
apiVersion: v1kind: Secretmetadata:name: aws-credentialnamespace: singlestoretype: OpaquestringData:AWS_ACCESS_KEY: <AWS-Access-Key>AWS_SECRET_ACCESS_KEY: <AWS-Secret>
As of Operator 1.userSecret
in backupSpec
, or via backup-user-secret
Operator command line parameter in sdb-operator.
.backupSpec
in the CR takes precedence over the parameter specified in sdb-operator.
.
The following is an example backup-user-secret.
file.
apiVersion: v1kind: Secretmetadata:name: backup-user-secretnamespace: singlestoretype: OpaquestringData:BACKUP_USERNAME: <username>BACKUP_PASSWORD: <password>
Last modified: October 17, 2023