---
title: "Configuration settings for an Aerospike Backup on Kubernetes"
description: "Configure Aerospike Backup on Kubernetes using the AerospikeBackup CR with YAML examples for scheduling and TLS."
---

# Configuration settings for an Aerospike Backup on Kubernetes

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

Aerospike Backup configuration settings are in the Aerospike Backup Custom Resource (CR). Aerospike Kubernetes Operator (AKO) monitors this file to schedule backups or trigger an immediate on-demand backup.

The [AerospikeBackup Custom Resource Definition (CRD)](https://github.com/aerospike/aerospike-kubernetes-operator/blob/v4.4.1/config/crd/bases/asdb.aerospike.com_aerospikebackups.yaml) specifies the CR structure that AKO uses to configure and create the backup.

## CR examples

CR examples are available in [the main Aerospike Kubernetes Operator repository](https://github.com/aerospike/aerospike-kubernetes-operator/tree/v4.4.1/config/samples).

### Example 1: CR with scheduled backups

This example schedules periodic full and incremental backups for an Aerospike cluster.

Example 1

```yaml
apiVersion: asdb.aerospike.com/v1beta1

kind: AerospikeBackup

metadata:

    name: aerospikebackup

    namespace: aerospike

spec:

  backupService:

    name: aerospikebackupservice

    namespace: aerospike

  config:

    aerospike-cluster:

      # Name format: The name must begin with the prefix <backup-namespace>-<backup-name>

      aerospike-aerospikebackup-test-cluster:

        credentials:

          password: admin123

          user: admin

        seed-nodes:

          - host-name: aerocluster.aerospike.svc.cluster.local

            port: 3000

    backup-routines:

      # Name format: The name must begin with the prefix <backup-namespace>-<backup-name>

      aerospike-aerospikebackup-test-routine:

        backup-policy: test-policy

        interval-cron: "@daily"

        incr-interval-cron: "@hourly"

        namespaces: ["test"]

        source-cluster: aerospike-aerospikebackup-test-cluster

        storage: local
```

### Example 2: CR with scheduled backups with a password file path

This example schedules periodic Full and Incremental backups for an Aerospike cluster with a password file path.

Example 2

```yaml
apiVersion: asdb.aerospike.com/v1beta1

kind: AerospikeBackup

metadata:

    name: aerospikebackup

    namespace: aerospike

spec:

  backupService:

    name: aerospikebackupservice

    namespace: aerospike

  config:

    aerospike-cluster:

      # Name format: The name must begin with the prefix <backup-namespace>-<backup-name>

      aerospike-aerospikebackup-test-cluster:

        credentials:

          # Make sure the password file is mounted in the backup service pod using a secret at the path specified here.

          password-path: /etc/aerospike/secret/password

          user: admin

        seed-nodes:

          - host-name: aerocluster.aerospike.svc.cluster.local

            port: 3000

    backup-routines:

      # Name format: The name must begin with the prefix <backup-namespace>-<backup-name>

      aerospike-aerospikebackup-test-routine:

        backup-policy: test-policy

        interval-cron: "@daily"

        incr-interval-cron: "@hourly"

        namespaces: ["test"]

        source-cluster: aerospike-aerospikebackup-test-cluster

        storage: local
```

### Example 3: CR with TLS-enabled Aerospike cluster

This example schedules periodic backups for a TLS-enabled Aerospike cluster. The TLS certificates must be mounted in the backup service pod using secrets.

Example 3

```yaml
apiVersion: asdb.aerospike.com/v1beta1

kind: AerospikeBackup

metadata:

  name: aerospikebackup

  namespace: aerospike

spec:

  backupService:

    name: aerospikebackupservice

    namespace: aerospike

  config:

    aerospike-cluster:

      # Name format: The name must begin with the prefix <backup-namespace>-<backup-name>

      aerospike-aerospikebackup-tls-cluster:

        credentials:

          password: admin123

          user: admin

        seed-nodes:

          - host-name: aerocluster.aerospike.svc.cluster.local

            port: 4333

            tls-name: aerospike-a-0.test-runner

        tls:

          # Path to CA certificate file or directory

          ca-file: /etc/aerospike/secret/cacert.pem

          # TLS name used for certificate verification

          name: aerospike-a-0.test-runner

          # Path to client certificate file

          cert-file: /etc/aerospike/secret/svc_cluster_chain.pem

          # Path to client private key file

          key-file: /etc/aerospike/secret/svc_key.pem

    backup-routines:

      # Name format: The name must begin with the prefix <backup-namespace>-<backup-name>

      aerospike-aerospikebackup-tls-routine:

        backup-policy: test-policy

        interval-cron: "@daily"

        incr-interval-cron: "@hourly"

        namespaces: ["test"]

        source-cluster: aerospike-aerospikebackup-tls-cluster

        storage: local
```

::: note
When using TLS, ensure that:

1.  The TLS certificates are mounted in the backup service pod by using the `secrets` field in the [AerospikeBackupService CR](https://aerospike.com/docs/kubernetes/4.4.x/tools/backup/backup-service-configuration#example-4-cr-with-tls-enabled-aerospike-cluster).
2.  The `tls-name` in `seed-nodes` matches the TLS name configured in your Aerospike cluster.
3.  The `port` is set to the TLS service port (typically 4333 instead of 3000).
:::

## Configuration

The initial part of the CR file selects the CRD and the namespace to use for the Aerospike Backup.

```yaml
apiVersion: asdb.aerospike.com/v1beta1

kind: AerospikeBackup

metadata:

  name: aerospikebackup

  namespace: aerospike
```

The rest of this page explains the parameters in the subsequent parts of the CR file.

## Spec

The spec section defines the backup’s configurations.

| Field | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| [backupService](#backup-service) | Yes | Structure |  | Aerospike backup service reference. |
| [config](#config) | Yes | Structure |  | Aerospike backup configuration in freeform YAML format. |
| [onDemandBackups](#on-demand-backups) | No | Structure | nil | List of on-demand backups to be triggered. |

## Backup service

[`spec`](#spec) -> `backupService`

Configure the Aerospike backup service to be used for taking backups.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| name | Yes | String | Name of the backup service. |
| namespace | Yes | String | Namespace of the backup service. |

## Config

[`spec`](#spec) -> `config`

The YAML form of Aerospike Backup configuration. The following fields can be defined in the Aerospike Backup configuration:

-   `aerospike-cluster`: only one Aerospike cluster can be configured.
-   `backup-routines`: multiple backup routines can be configured.

Example:

```yaml
config:

  aerospike-cluster:

      # Name format: The name must begin with the prefix <backup-namespace>-<backup-name>

    aerospike-aerospikebackup-test-cluster:

      credentials:

        password: admin123

        user: admin

      seed-nodes:

        - host-name: aerocluster.aerospike.svc.cluster.local

          port: 3000

  backup-routines:

      # Name format: The name must begin with the prefix <backup-namespace>-<backup-name>

    aerospike-aerospikebackup-test-routine:

      backup-policy: test-policy

      interval-cron: "@daily"

      incr-interval-cron: "@hourly"

      namespaces: ["test"]

      source-cluster: aerospike-aerospikebackup-test-cluster

      storage: local
```

### Resource naming rule:

`aerospike-cluster` and `backup-routines` names must start with a prefix `<backup-namespace>-<backup-name>`. The prefix is the namespace and name of the backup CR.

See the [Aerospike Backup Configuration reference](https://aerospike.com/docs/database/tools/backup-and-restore/backup-service/config-examples) for more details.

### On-demand Backups

[`spec`](#spec) -> `onDemandBackups`

Configure the on-demand backups for an Aerospike cluster.

| Field | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| id | Yes | String |  | Unique identifier for the on-demand request operation in the CR. |
| routineName | Yes | String |  | Routine name to use to trigger on-demand backup. |
| delay | No | String |  | Delay interval before starting the on-demand backup. |
| type | No | Enum - Full, Incremental | Full | Type of on-demand backup. |