CouchbaseBackup and CouchbaseBackupRestore Status

Status fields attached to CouchbaseBackup and CouchbaseBackupRestore resources by the Operator.

Each CouchbaseBackup and CouchbaseBackupRestore resource has a status object. These resources share very similar status objects which is why they have been collated into this single document. This object is used to communicate current resources and updates associated with the backup environment. The provided status information should be helpful in pairing an associate CouchbaseBackupRestore resource to a existing CouchbaseBackup resource, for example, without requiring to explore the contents of a Persistent Volume Claim.

Status fields should be considered read only. Any modifications will not affect either resource and will be reverted by the Operator.

An example status object may look like the following, with individual attributes explained below:

apiVersion: couchbase.com/v2
kind: CouchbaseBackup
status:
  archive: /data/backups
  capacityUsed: 1.76Gi
  cronjob: cbbackup-full-full
  duration: 13s
  failed: false
  job: cbbackup-full-full-1584385800
  lastFailure: "2020-02-11T17:18:23Z"
  lastRun: "2020-03-16T19:10:10Z"
  lastSuccess: "2020-03-16T19:10:23Z"
  output: '{"location": "2020-03-16T19_10_10.637314674Z", "duration_seconds": "11.992174441",
    "avg_data_transfer_rate_bytes_sec": 7172259, "total_items": 100000, "total_items_size_bytes":
    85951774, "buckets": {"default": {"mutations_backedup": "100000", "mutations_failed":
    "0", "deletions_backedup": "0", "deletions_failed": "0"}}}'
  pod: cbbackup-full-full-1584385800-n6xm8
  repo: cb-example-2020-03-16T19_10_10
  repoList: cb-example-2020-03-16T19_09_09, cb-example-2020-03-16T19_10_10
  running: false

The CouchbaseBackup custom resource definition defines custom formatting that is used by the following command:

$ kubectl get couchbasebackups
NAME            STRATEGY    VOLUME SIZE   CAPACITY USED   LAST RUN               LAST SUCCESS           RUNNING   AGE
my-cbbackup     full_only   5Gi           1.76Gi          2020-03-16T18:48:07Z   2020-03-16T18:48:18Z   false     71s

These fields are provided for convenience when looking up and configuring clusters and map to status variables as follows:

STRATEGY

spec.strategy

SIZE

spec.size

CAPACITYUSED

status.capacityUsed

LASTRUN

status.lastRun

LASTSUCCESS

status.lastSuccess

RUNNING

status.running

The CouchbaseBackupRestore custom resource definition provides a very similar status object and custom formatting:

apiVersion: couchbase.com/v2
kind: CouchbaseBackupRestore
status:
  archive: /data/backups
  capacityUsed: 2.03Gi
  duration: 11s
  failed: false
  job: cbrestore
  lastFailure: "2020-02-11T17:18:23Z"
  lastRun: "2020-03-16T19:12:51Z"
  lastSuccess: "2020-03-16T19:13:02Z"
  output: '{"buckets": {"default": {"mutations": {"succeeded": "100000", "failed": "0",
    "skipped": "0"}, "deletions": {"succeeded": "0", "failed": "0", "skipped":
    "0"}}}, "backups_restored": "1", "duration_seconds": "10.123074814", "avg_data_transfer_rate_bytes_sec":
    1992294, "total_items": "100000", "total_items_size_bytes": 20143144}'
  pod: cbrestore-ts4br
  repo: cb-example-2020-03-16T19_10_10
  repoList: cb-example-2020-03-16T19_08_10, cb-example-2020-03-16T19_09_09, cb-example-2020-03-16T19_10_10,
    cb-example-2020-03-16T19_11_09, cb-example-2020-03-16T19_12_10
  running: false

The CouchbaseBackupRestore custom resource definition defines custom formatting that is used by the following command:

NAME        CAPACITY USED   LAST RUN               LAST SUCCESS           DURATION   RUNNING   AGE
cbrestore   2.03Gi          2020-03-16T19:12:51Z   2020-03-16T19:13:02Z   11s        false     8s

These fields are provided for convenience when looking up and configuring clusters and map to status variables as follows:

CAPACITYUSED

status.capacityUsed

LASTRUN

status.lastRun

LASTSUCCESS

status.lastSuccess

DURATION

status.duration

RUNNING

status.running

status

This section defines and describes individual status fields for both CouchbaseBackup and CouchbaseBackupRestore status objects, unless otherwise stated.

status.archive

This is the absolute path of where all backups and logs are stored. Persistent Volume Claims are mounted onto pods at the path /data. This absolute path cannot be changed currently so this field really exists for validation.

Field rules: This field will be a string and should always be /data/backups after the first backup is run.

status.capacityUsed

The used capacity of the mounted Persistent Volume Claim.

Field rules: This field will be a string.

status.cronjob

This field is only applicable to CouchbaseBackup objects and tells us the name of the most recent or currently running Cronjob.

Field rules: This field will be a string.

status.duration

This field tells us how long in seconds the last job took to complete.

Field rules: This field will be a duration.

status.failed

This field tells us whether the most recent job failed.

Field rules: This field will be a boolean.

status.job

The name of the most recent or currently running job.

Field rules: This field will be a string.

status.lastFailure

A timestamp telling us when the last failed job occurred.

Field rules: This field will be a string and conform to RFC-3339

status.lastRun

A timestamp telling us when the last job was executed.

Field rules: This field will be a string and conform to RFC-3339

status.lastSuccess

A timestamp telling us when the last successful job occurred.

Field rules: This field will be a string and conform to RFC-3339

status.output

Output passes through the output of the most recent cbbackupmgr execution.

Field rules: This field will be a string.

status.pod

The name of the most recent or currently running pod that runs cbbackupmgr.

Field rules: This field will be a string.

status.repo

The name of the folder that we are currently working in or most recently performed operations in.

Field rules: This field will be a string.

status.repoList

repoList provides a list of all the repos that exist in the backup archive /data/backups, which should aid in selecting one to create a CouchbaseBackupRestore.

Field rules: This field will be a string.

status.running

Whether the condition is True or False.

Field rules: This field will be a string, and either True or False.