ArangoBackup Custom Resource

The ArangoBackup Operator creates and maintains ArangoBackupsin a Kubernetes cluster, given a Backup specification.This deployment specification is a CustomResource followinga CustomResourceDefinition created by the operator.

Examples:

Create simple Backup

  1. apiVersion: "backup.arangodb.com/v1alpha"
  2. kind: "ArangoBackup"
  3. metadata:
  4. name: "example-arangodb-backup"
  5. namespace: "arangodb"
  6. spec:
  7. deployment:
  8. name: "my-deployment"

Action:

Create Backup on ArangoDeployment named my-deployment

Create and upload Backup

  1. apiVersion: "backup.arangodb.com/v1alpha"
  2. kind: "ArangoBackup"
  3. metadata:
  4. name: "example-arangodb-backup"
  5. namespace: "arangodb"
  6. spec:
  7. deployment:
  8. name: "my-deployment"
  9. upload:
  10. repositoryURL: "S3://test/kube-test"
  11. credentialsSecretName: "my-s3-rclone-credentials"

Action:

Create Backup on ArangoDeployment named my-deployment and upload it to S3://test/kube-test.

Download Backup

  1. apiVersion: "backup.arangodb.com/v1alpha"
  2. kind: "ArangoBackup"
  3. metadata:
  4. name: "example-arangodb-backup"
  5. namespace: "arangodb"
  6. spec:
  7. deployment:
  8. name: "my-deployment"
  9. download:
  10. repositoryURL: "S3://test/kube-test"
  11. credentialsSecretName: "my-s3-rclone-credentials"
  12. id: "backup-id"

Download Backup with id backup-id from S3://test/kube-test on ArangoDeployment named my-deployment

Restore

Information about restoring can be found in ArangoDeployment.

Advertised fields

List of custom columns in CRD specification for Kubectl:

  • .spec.policyName - optional name of the policy
  • .spec.deployment.name - name of the deployment
  • .status.state - current ArangoBackup Custom Resource state
  • .status.message - additional message for current state

ArangoBackup Custom Resource Spec:

  1. apiVersion: "backup.arangodb.com/v1alpha"
  2. kind: "ArangoBackup"
  3. metadata:
  4. name: "example-arangodb-backup"
  5. namespace: "arangodb"
  6. spec:
  7. policyName: "my-policy"
  8. deployment:
  9. name: "my-deployment"
  10. options:
  11. timeout: 3
  12. force: true
  13. download:
  14. repositoryURL: "s3:/..."
  15. credentialsSecretName: "secret-name"
  16. id: "backup-id"
  17. upload:
  18. repositoryURL: "s3:/..."
  19. credentialsSecretName: "secret-name"
  20. status:
  21. state: "Ready"
  22. time: "time"
  23. message: "Message details" -
  24. progress:
  25. jobID: "id"
  26. progress: "10%"
  27. backup:
  28. id: "id"
  29. version: "3.6.0-dev"
  30. forced: true
  31. uploaded: true
  32. downloaded: true
  33. createdAt: "time"
  34. sizeInBytes: 1
  35. numberOfDBServers: 3
  36. available: true

spec: Object

Spec of the ArangoBackup Custom Resource.

Required: true

Default: {}

spec.deployment: Object

ArangoDeployment specification.

Field is immutable.

Required: true

Default: {}

spec.deployment.name: String

Name of the ArangoDeployment Custom Resource within same namespace as ArangoBackup Custom Resource.

Field is immutable.

Required: true

Default: “”

spec.policyName: String

Name of the ArangoBackupPolicy which created this Custom Resource

Field is immutable.

Required: false

Default: “”

spec.options: Object

Backup options.

Field is immutable.

Required: false

Default: {}

spec.options.timeout: float

Timeout for Backup creation request in seconds.

Field is immutable.

Required: false

Default: 30

spec.options.allowInconsistent: bool

AllowInconsistent flag for Backup creation request.If this value is set to true, backup is taken even if we are not able to acquire lock.

Field is immutable.

Required: false

Default: false

spec.download: Object

Backup download settings.

Field is immutable.

Required: false

Default: {}

spec.download.repositoryURL: string

Field is immutable. Protocol needs to be defined in spec.download.credentialsSecretName if protocol is other than local.

Mode protocols can be found at rclone.org.

Format: <protocol>:/<path>

Examples:

  • s3://my-bucket/test
  • azure://test

Required: true

Default: “”

spec.download.credentialsSecretName: string

Field is immutable. Name of the secret used while accessing repository

Secret structure:

  1. apiVersion: v1
  2. data:
  3. token: <json token>
  4. kind: Secret
  5. metadata:
  6. name: <name>
  7. type: Opaque

JSON Token options are described on the Rclone page.We can define more than one protocols at same time in one secret.

This field is defined in json format:

  1. {
  2. "<protocol>": {
  3. "type":"<type>",
  4. ...parameters
  5. }
  6. }

AWS S3 example - based on Rclone S3 documentation and interactive process:

  1. {
  2. "S3": {
  3. "type": "s3", # Choose s3 type
  4. "provider": "AWS", # Choose one of the providers
  5. "env_auth": "false", # Define credentials in next step instead of using ENV
  6. "access_key_id": "xxx",
  7. "secret_access_key": "xxx",
  8. "region": "eu-west-2", # Choose region
  9. "acl": "private", # Set permissions on newly created remote object
  10. }
  11. }

and you can from now use S3://bucket/path.

Required: false

Default: “”

spec.download.id: string

ID of the ArangoBackup to be downloaded.

Field is immutable.

Required: true

Default: “”

spec.upload: Object

Backup upload settings.

This field can be removed and created again with different values. This operation will trigger upload again.Fields in Custom Resource Spec Upload are immutable.

Required: false

Default: {}

spec.upload.repositoryURL: string

Same structure as spec.download.repositoryURL.

Required: true

Default: “”

spec.upload.credentialsSecretName: string

Same structure as spec.download.credentialsSecretName.

Required: false

Default: “”

status: Object

Status of the ArangoBackup Custom Resource. This field is managed by subresource and only by operator

Required: true

Default: {}

status.state: enum

State of the ArangoBackup object.

Required: true

Default: “”

Possible states:

  • ”” - default state, changed to “Pending”
  • “Pending” - state in which Custom Resource is queued. If Backup is possible changed to “Scheduled”
  • “Scheduled” - state which will start create/download process
  • “Download” - state in which download request will be created on ArangoDB
  • “DownloadError” - state when download failed
  • “Downloading” - state for downloading progress
  • “Create” - state for creation, field available set to true
  • “Upload” - state in which upload request will be created on ArangoDB
  • “Uploading” - state for uploading progress
  • “UploadError” - state when uploading failed
  • “Ready” - state when Backup is finished
  • “Deleted” - state when Backup was once in ready, but has been deleted
  • “Failed” - state for failure
  • “Unavailable” - state when Backup is not available on the ArangoDB. It can happen in case of upgrades, node restarts etc.

status.time: timestamp

Time in UTC when state of the ArangoBackup Custom Resource changed.

Required: true

Default: “”

status.message: string

State message of the ArangoBackup Custom Resource.

Required: false

Default: “”

status.progress: object

Progress info of the uploading and downloading process.

Required: false

Default: {}

status.progress.jobID: string

ArangoDB job ID for uploading or downloading.

Required: true

Default: “”

status.progress.progress: string

ArangoDeployment job progress.

Required: true

Default: “0%”

status.backup: object

ArangoBackup details.

Required: true

Default: {}

status.backup.id: string

ArangoBackup ID.

Required: true

Default: “”

status.backup.version: string

ArangoBackup version.

Required: true

Default: “”

status.backup.potentiallyInconsistent: bool

ArangoBackup potentially inconsistent flag.

Required: false

Default: false

status.backup.uploaded: bool

Determines if ArangoBackup has been uploaded.

Required: false

Default: false

status.backup.downloaded: bool

Determines if ArangoBackup has been downloaded.

Required: false

Default: false

status.backup.createdAt: TimeStamp

ArangoBackup Custom Resource creation time in UTC.

Required: true

Default: now()

status.backup.sizeInBytes: uint64

Size of the Backup in ArangoDB.

Required: true

Default: 0

status.backup.numberOfDBServers: uint

Cluster size of the Backup in ArangoDB.

Required: true

Default: 0

status.available: bool

Determines if we can restore from ArangoBackup.

Required: true

Default: false