A newer version of this documentation is available.

View Latest

CouchbaseBackup Resource

      +

      Once you have allowed the Autonomous Operator to manage and perform Automated Backup, you will need to create a CouchbaseBackup object to specify the timings and details of the backups.

      A CouchbaseBackup object will spawn either 1 or 2 cronjobs that belong to that resource, and those cronjobs in turn will create the Kubernetes jobs which perform the backup jobs themselves.

      The following YAML shows all possible fields that may be configured for a CouchbaseBackup. In this case the following YAML is completely valid.

      All available CouchbaseBackup configuration parameters
      apiVersion: couchbase.com/v2
      kind: CouchbaseBackup
      metadata:
        name: my-backup
        labels:
          cluster: my-cluster
      spec:
        strategy: full_incremental
        full:
          schedule: "0 3 * * 0"
        incremental:
          schedule: "0 3 * * 1-6"
        successfulJobsHistoryLimit: 1
        failedJobsHistoryLimit: 3
        backOffLimit: 2
        backupRetention: 24h
        logRetention: 24h
        size: 5Gi

      Top-Level Definitions

      The following are the top-level parameters that can be defined:

      apiVersion: couchbase.com/v2
      kind: CouchbaseBackup
      metadata:
        name: my-backup
        labels:
          cluster: my-cluster

      apiVersion

      The apiVersion defines which version of the resource this configuration refers to.

      Field rules: This field is required and must be set to couchbase.com/v2

      kind

      The kind defines the type of resource this configuration refers to.

      Field rules: This field is required and must be set to CouchbaseBackup

      metadata.name

      The metadata name defines the name of the resource. The name must be unique for the kind defined.

      Field rules: This field is required and must be unique as described above.

      metadata.labels

      The metadata labels allow the resource to be tagged so that it is only selected by specific CouchbaseCluster resources. Further details about resource selection can be found on the Couchbase Resources and RBAC page.

      Field rules: This field is optional and must be a map of string key/value pairs.

      spec

      The following are parameters that may be set on the CouchbaseBackup:

      spec:
        strategy: full_incremental
        full:
          schedule: "0 3 * * 0"
        incremental:
          schedule: "0 3 * * 1-6"
        successfulJobsHistoryLimit: 1
        failedJobsHistoryLimit: 3
        backOffLimit: 2
        backupRetention: 24h
        logRetention: 24h
        size: 5Gi

      spec.strategy

      This field defines which backup strategy to use for Automated Backup. The following backup strategies are supported: Full Backup Only and Full/Incremental. For more information about these backup strategies, please refer to the cbbackupmgr documentation.

      Field rules: This field is required and must be either full_only or full_incremental.

      spec.full.schedule

      This field defines the schedule a user wants the Operator to perform a full backup of the cluster.

      Field rules: This field is required for both strategies and must be a valid Cron schedule.

      spec.incremental.schedule

      This field defines the schedule a user wants the Operator to perform an incremental backup of the cluster.

      Field rules: This field is only required for a full_incremental strategy and must be a valid Cron schedule.

      spec.successfulJobsHistoryLimit

      This field defines the amount of successful jobs to keep before Kubernetes starts deleting older ones.

      Field rules: This field is optional and must be any non-negative integer. The default value is 3.

      spec.failedJobsHistoryLimit

      This field defines the amount of failed jobs to keep before Kubernetes starts deleting older ones.

      Field rules: This field is optional and must be any non-negative integer. The default value is 5.

      spec.backOffLimit

      This field defines the amount of times one backup job will try to perform a backup. Once it has reached the backOffLimit the job will no longer run and the next attempted backup will occur at the next run of the cronjob.

      Field rules: This field is optional and must be any non-negative integer. The default value is 2.

      spec.backupRetention

      This field defines the time period in which to retain existing backups. On each run of a backup job older backups outside this time frame are deleted.

      Field rules: This field is optional and defaults to 720h (30 days). If specified it must contain a decimal number and a unit suffix such as s, m or h. The decimal number cannot be negative.

      spec.logRetention

      This field defines the time period in which to retain backup logs. Older logs outside this time frame are deleted. On each run of a backup job logging takes place which is stored on the Persistent Volume of the same name as the CouchbaseBackup object.

      Field rules: This field is optional and defaults to 168h (7 days). If specified it must contain a decimal number and a unit suffix such as s, m or h. The decimal number cannot be negative.

      spec.size

      This field defines the size of the Persistent Volume to store backups and logs on.

      Field rules: This field is optional and defaults to 20Gi. If specified the field must be a Kubernetes resource quantity.