March 16, 2025
+ 12

CouchbaseBackupRestore allows the restoration of all Couchbase cluster data from a CouchbaseBackup resource.

The following is an example resource, depicting the overall structure and any defaults (consult the field reference for valid values for "empty" values, such as empty strings etc.):

yaml
apiVersion: v2 kind: CouchbaseBackupRestore metadata: name: "" spec: backoffLimit: 2 backup: "" buckets: data: exclude: - "" filterKeys: "" filterValues: "" include: - "" map: - source: "" target: "" end: int: 0 str: "" forceUpdates: false logRetention: 168h objectStore: endpoint: secret: "" url: "" useVirtualPath: false secret: "" uri: "" useIAM: false overwriteUsers: false repo: "" s3bucket: "" services: analytics: True bucketConfig: false bucketQuery: True clusterAnalytics: True clusterQuery: True data: True eventing: True ftAlias: True ftIndex: True gsiIndex: True users: false views: True stagingVolume: size: 20Gi storageClassName: "" start: int: 0 str: "" threads: 1 ttlSecondsAfterFinished: 0 status: archive: "" backups: - full: "" incrementals: - "" name: "" duration: "" failed: false job: "" lastFailure: "" lastRun: "" lastSuccess: "" output: "" pod: "" repo: "" running: false

couchbasebackuprestores.apiVersion

Constraints

Type: string

Description

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources.

couchbasebackuprestores.kind

Constraints

Type: string

Description

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds.

couchbasebackuprestores.metadata

Constraints

Required

Type: object

Description

Standard object metadata as defined for all Kubernetes types.

For additional details see the Kubernetes reference documentation.

couchbasebackuprestores.metadata.name

Constraints

Type: string

Description

The name of a resource. This must be unique for the kind of resource within the namespace.

All resources must have a name. The name may be omitted and metadata.generateName used instead to generate a unique resource name.

For additional details on resource names, see the Kubernetes reference documentation.

couchbasebackuprestores.metadata.namespace

Constraints

Type: string

Description

The namespace the resource resides in. All resources reside in a namespace.

The namespace is optional and may be specified in YAML configuration to override the namespace supplied by kubectl.

For additional details on namespaces, see the Kubernetes reference documentation.

couchbasebackuprestores.metadata.labels

Constraints

Type: map[string]string

Description

Labels allow resources to be labeled with key/value pairs of data. Labels are indexed and allow resources to be selected based upon specified labels.

Labels are relevant for certain types when using label selection within your resources.

For additional details on labels and selectors, see the Kubernetes reference documentation.

couchbasebackuprestores.metadata.annotations

Constraints

Type: map[string]string

Description

Annotations allow resources to be annotated with key/value pairs of data. Annotations are arbitrary, and not indexed, so cannot be used to select resources, however may be used to add context or accounting to your resources.

For additional details on annotations, see the Kubernetes reference documentation.

couchbasebackuprestores.spec

Constraints

Required

Type: object

Description

CouchbaseBackupRestoreSpec allows the specification of data restoration to be configured. This includes the backup and repository to restore data from, and the time range of data to be restored.

couchbasebackuprestores.spec.backoffLimit

Constraints

Type: integer

Default: 2

Description

Number of times the restore job should try to execute.

couchbasebackuprestores.spec.backup

Constraints

Type: string

Description

The backup resource name associated with this restore, or the backup PVC name to restore from.

couchbasebackuprestores.spec.buckets

Constraints

Type: object

Description

DEPRECATED - by spec.data.

Specific buckets can be explicitly included or excluded in the restore, as well as bucket mappings. This field is now ignored.

couchbasebackuprestores.spec.data

Constraints

Type: object

Description

Data allows control over what key-value/document data is included in the restore. By default, all data is included.

couchbasebackuprestores.spec.data.exclude

Constraints

Type: []string

Minimum Items: 1

Pattern (Regular Expression): ^(?:[a-zA-Z0-9\-%]|\\.){1,100}(\._default(\._default)?|\.[a-zA-Z0-9\-][a-zA-Z0-9\-%]{0,29}(\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29})?)?$

Description

Exclude defines the buckets, scopes or collections that are excluded from the backup. When this field is set, it implies that by default everything will be backed up, and data items can be explicitly excluded. You may define an exclusion as a bucket — my-bucket, a scope — my-bucket.my-scope, or a collection — my-bucket.my-scope.my-collection. Buckets may contain periods, and therefore must be escaped — my\.bucket.my-scope, as period is the separator used to delimit scopes and collections. Excluded data cannot overlap e.g. specifying my-bucket and my-bucket.my-scope is illegal. This field cannot be used at the same time as included items.

couchbasebackuprestores.spec.data.filterKeys

Constraints

Type: string

Description

FilterKeys only restores documents whose names match the provided regular expression.

couchbasebackuprestores.spec.data.filterValues

Constraints

Type: string

Description

FilterValues only restores documents whose values match the provided regular expression.

couchbasebackuprestores.spec.data.include

Constraints

Type: []string

Minimum Items: 1

Pattern (Regular Expression): ^(?:[a-zA-Z0-9\-%]|\\.){1,100}(\._default(\._default)?|\.[a-zA-Z0-9\-][a-zA-Z0-9\-%]{0,29}(\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29})?)?$

Description

Include defines the buckets, scopes or collections that are included in the restore. When this field is set, it implies that by default nothing will be restored, and data items must be explicitly included. You may define an inclusion as a bucket — my-bucket, a scope — my-bucket.my-scope, or a collection — my-bucket.my-scope.my-collection. Buckets may contain periods, and therefore must be escaped — my\.bucket.my-scope, as period is the separator used to delimit scopes and collections. Included data cannot overlap e.g. specifying my-bucket and my-bucket.my-scope is illegal. This field cannot be used at the same time as excluded items.

couchbasebackuprestores.spec.data.map

Constraints

Type: []object

Description

Map allows data items in the restore to be remapped to a different named container. Buckets can be remapped to other buckets e.g. "source=target", scopes and collections can be remapped to other scopes and collections within the same bucket only e.g. "bucket.scope=bucket.other" or "bucket.scope.collection=bucket.scope.other". Map sources may only be specified once, and may not overlap.

couchbasebackuprestores.spec.data.map.source

Constraints

Required

Type: string

Pattern (Regular Expression): ^(?:[a-zA-Z0-9\-%]|\\.){1,100}(\._default(\._default)?|\.[a-zA-Z0-9\-][a-zA-Z0-9\-%]{0,29}(\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29})?)?$

Description

Source defines the data source of the mapping, this may be either a bucket, scope or collection.

couchbasebackuprestores.spec.data.map.target

Constraints

Required

Type: string

Pattern (Regular Expression): ^(?:[a-zA-Z0-9\-%]|\\.){1,100}(\._default(\._default)?|\.[a-zA-Z0-9\-][a-zA-Z0-9\-%]{0,29}(\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29})?)?$

Description

Target defines the data target of the mapping, this may be either a bucket, scope or collection, and must refer to the same type as the restore source.

couchbasebackuprestores.spec.end

Constraints

Type: object

Description

End denotes the last backup to restore from. Omitting this field will only restore the backup referenced by start. This may be specified as an integer index (starting from 1), a string specifying a short date DD-MM-YYYY, the backup name, or one of either start or oldest keywords.

couchbasebackuprestores.spec.end.int

Constraints

Type: integer

Minimum: 1

Description

Int references a relative backup by index.

couchbasebackuprestores.spec.end.str

Constraints

Type: string

Description

Str references an absolute backup by name.

couchbasebackuprestores.spec.forceUpdates

Constraints

Type: boolean

Description

Forces data in the Couchbase cluster to be overwritten even if the data in the cluster is newer. By default, the system does not force updates, and all updates use Couchbase’s conflict resolution mechanism to ensure that if newer data exists on the cluster, older restored data does not overwrite it. However, if couchbasebackuprestores.spec.forceUpdates is true, then the backup record will always overwrite the cluster record, regardless of Couchbase’s conflict resolution.

couchbasebackuprestores.spec.logRetention

Constraints

Type: string

Default: 168h

Description

Number of hours to hold restore script logs for, everything older will be deleted. More info: https://golang.org/pkg/time/#ParseDuration.

couchbasebackuprestores.spec.objectStore

Constraints

Type: object

Description

The remote destination for backup.

couchbasebackuprestores.spec.objectStore.endpoint

Constraints

Type: object

Description

Endpoint contains the configuration for connecting to a custom Azure/S3/GCP compliant object store. If set will override CouchbaseCluster.spec.backup.objectEndpoint See https://docs.couchbase.com/server/current/backup-restore/cbbackupmgr-cloud.html#compatible-object-stores.

couchbasebackuprestores.spec.objectStore.endpoint.secret

Constraints

Type: string

Description

The name of the secret, in this namespace, that contains the CA certificate for verification of a TLS endpoint The secret must have the key with the name "tls.crt".

couchbasebackuprestores.spec.objectStore.endpoint.url

Constraints

Type: string

Description

The host/address of the custom object endpoint.

couchbasebackuprestores.spec.objectStore.endpoint.useVirtualPath

Constraints

Type: boolean

Description

UseVirtualPath will force the AWS SDK to use the new virtual style paths which are often required by S3 compatible object stores.

couchbasebackuprestores.spec.objectStore.secret

Constraints

Type: string

Description

ObjStoreSecret must contain two fields, access-key-id, secret-access-key and optionally either region or refresh-token. These correspond to the fields used by cbbackupmgr https://docs.couchbase.com/server/current/backup-restore/cbbackupmgr-backup.html#optional-2.

couchbasebackuprestores.spec.objectStore.uri

Constraints

Type: string

Pattern (Regular Expression): ^(az|s3|gs)://.{3,}$

Description

URI is a reference to a remote object store. This is the prefix of the object store and the bucket name. i.e s3://bucket, az://bucket or gs://bucket.

couchbasebackuprestores.spec.objectStore.useIAM

Constraints

Type: boolean

Description

Whether to allow the backup SDK to attempt to authenticate using the instance metadata api. If set, will override CouchbaseCluster.spec.backup.useIAM.

couchbasebackuprestores.spec.overwriteUsers

Constraints

Type: boolean

Default: False

Description

Overwrites the already existing users in the cluster when user restoration is enabled (spec.services.users). The default behavior of backup/restore of users is to skip already existing users. This is only available for Couchbase Server 7.6 and later. This field defaults to false.

couchbasebackuprestores.spec.repo

Constraints

Type: string

Description

Repo is the backup folder to restore from. If no repository is specified, the backup container will choose the latest.

couchbasebackuprestores.spec.s3bucket

Constraints

Type: string

Pattern (Regular Expression): ^s3://[a-z0-9-\.\/]{3,63}$

Description

DEPRECATED - by spec.objectStore.uri Name of S3 bucket to restore from.

If non-empty this overrides local backup.

couchbasebackuprestores.spec.services

Constraints

Type: object

Default: {}

Description

This list accepts a certain set of parameters that will disable that data and prevent it being restored.

couchbasebackuprestores.spec.services.analytics

Constraints

Type: boolean

Default: True

Description

Analytics restores analytics datasets from the backup. This field defaults to true.

couchbasebackuprestores.spec.services.bucketConfig

Constraints

Type: boolean

Description

BucketConfig restores all bucket configuration settings. If you are restoring to cluster with managed buckets, then this option may conflict with existing bucket settings, and the results are undefined, so avoid use. This option is intended for use with unmanaged buckets. Note that bucket durability settings are not restored in versions less than and equal to 1.1.0, and will need to be manually applied. This field defaults to false.

couchbasebackuprestores.spec.services.bucketQuery

Constraints

Type: boolean

Default: True

Description

BucketQuery enables the backup of query metadata for all buckets. This field defaults to true.

couchbasebackuprestores.spec.services.clusterAnalytics

Constraints

Type: boolean

Default: True

Description

ClusterAnalytics enables the backup of cluster-wide analytics data, for example synonyms. This field defaults to true.

couchbasebackuprestores.spec.services.clusterQuery

Constraints

Type: boolean

Default: True

Description

ClusterQuery enables the backup of cluster level query metadata. This field defaults to true.

couchbasebackuprestores.spec.services.data

Constraints

Type: boolean

Default: True

Description

Data restores document data from the backup. This field defaults to true.

couchbasebackuprestores.spec.services.eventing

Constraints

Type: boolean

Default: True

Description

Eventing restores eventing functions from the backup. This field defaults to true.

couchbasebackuprestores.spec.services.ftAlias

Constraints

Type: boolean

Default: True

Description

FTAlias restores full-text search aliases from the backup. This field defaults to true.

couchbasebackuprestores.spec.services.ftIndex

Constraints

Type: boolean

Default: True

Description

FTIndex restores full-text search indexes from the backup. This field defaults to true.

couchbasebackuprestores.spec.services.gsiIndex

Constraints

Type: boolean

Default: True

Description

GSIIndex restores document indexes from the backup. This field defaults to true.

couchbasebackuprestores.spec.services.users

Constraints

Type: boolean

Default: False

Description

Users restores cluster level users, including their roles and permissions. This is only available for Couchbase Server 7.6 and later. This field defaults to false.

couchbasebackuprestores.spec.services.views

Constraints

Type: boolean

Default: True

Description

Views restores views from the backup. This field defaults to true.

couchbasebackuprestores.spec.stagingVolume

Constraints

Type: object

Default: {'size': '20Gi'}

Description

StagingVolume contains configuration related to the ephemeral volume used as staging when restoring from a cloud backup.

couchbasebackuprestores.spec.stagingVolume.size

Constraints

Type: string

Default: 20Gi

Pattern (Regular Expression): ^(\+|-)?[0-9]+(\.[0-9]*)?)|(\.[0-9]+[KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]\*)?)|(\.[0-9]+))?$

Description

Size allows the specification of a staging volume. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes The ephemeral volume will only be used when restoring from a cloud provider, if the backup job was created using ephemeral storage. Otherwise the restore job will share a staging volume with the backup job.

couchbasebackuprestores.spec.stagingVolume.storageClassName

Constraints

Type: string

Description

Name of StorageClass to use.

couchbasebackuprestores.spec.start

Constraints

Type: object

Description

Start denotes the first backup to restore from. This may be specified as an integer index (starting from 1), a string specifying a short date DD-MM-YYYY, the backup name, or one of either start or oldest keywords.

couchbasebackuprestores.spec.start.int

Constraints

Type: integer

Minimum: 1

Description

Int references a relative backup by index.

couchbasebackuprestores.spec.start.str

Constraints

Type: string

Description

Str references an absolute backup by name.

couchbasebackuprestores.spec.threads

Constraints

Type: integer

Default: 1

Minimum: 1

Description

How many threads to use during the restore.

couchbasebackuprestores.spec.ttlSecondsAfterFinished

Constraints

Type: integer

Minimum: 0

Description

Number of seconds to elapse before a completed job is deleted.

couchbasebackuprestores.status

Constraints

Type: object

Description

CouchbaseBackupRestoreStatus provides status indications of a restore from backup. This includes whether or not the restore is running, whether the restore succeed or not, and the duration the restore took.

couchbasebackuprestores.status.archive

Constraints

Type: string

Description

Location of Backup Archive.

couchbasebackuprestores.status.backups

Constraints

Type: []object

Description

Backups gives us a full list of all backups and their respective repository locations.

couchbasebackuprestores.status.backups.full

Constraints

Type: string

Description

Full backup inside the repository.

couchbasebackuprestores.status.backups.incrementals

Constraints

Type: []string

Description

Incremental backups inside the repository.

couchbasebackuprestores.status.backups.name

Constraints

Required

Type: string

Description

Name of the repository.

couchbasebackuprestores.status.duration

Constraints

Type: string

Description

Duration tells us how long the last restore took. More info: https://golang.org/pkg/time/#ParseDuration.

couchbasebackuprestores.status.failed

Constraints

Required

Type: boolean

Description

Failed indicates whether the most recent restore has failed.

couchbasebackuprestores.status.job

Constraints

Type: string

Description

DEPRECATED - field may no longer be populated.

Job tells us which job is running/ran last.

couchbasebackuprestores.status.lastFailure

Constraints

Type: string

Description

LastFailure tells us the time the last failed restore failed.

couchbasebackuprestores.status.lastRun

Constraints

Type: string

Description

LastRun tells us the time the last restore job started.

couchbasebackuprestores.status.lastSuccess

Constraints

Type: string

Description

LastSuccess gives us the time the last successful restore finished.

couchbasebackuprestores.status.output

Constraints

Type: string

Description

DEPRECATED - field may no longer be populated.

Output reports useful information from the backup process.

couchbasebackuprestores.status.pod

Constraints

Type: string

Description

DEPRECATED - field may no longer be populated.

Pod tells us which pod is running/ran last.

couchbasebackuprestores.status.repo

Constraints

Type: string

Description

Repo is where we are currently performing operations.

couchbasebackuprestores.status.running

Constraints

Required

Type: boolean

Description

Running indicates whether a restore is currently being performed.