---
title: "Aerospike Backup Service on Kubernetes"
description: "Deploy Aerospike Backup Service on Kubernetes, including service account setup and S3 storage configuration."
---

# Aerospike Backup Service on Kubernetes

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

::: caution
AKO version 4.x or later does not support Aerospike Backup Service version 2.x. Upgrade to Aerospike Backup Service v3.0.0 or later. See [Upgrade ABS](https://aerospike.com/docs/kubernetes/tools/backup/upgrade-backup-service) for more information.
:::

Aerospike Backup Service (ABS) runs alongside an Aerospike Database deployment and manages backup and restore operations. On a Kubernetes deployment, the configuration is provided in the ABS CR file.

## Requirements

Before deploying ABS, install AKO on your Kubernetes cluster using either:

-   [OLM](https://aerospike.com/docs/kubernetes/4.4.x/install/olm)
-   [Helm](https://aerospike.com/docs/kubernetes/4.4.x/install/helm)

## Install and deploy

We recommend using one ABS deployment per Aerospike cluster.

1.  Run the following command to create the ABS service account in the namespace where ABS is deployed.
    
    Terminal window
    
    ```shell
    kubectl create serviceaccount aerospike-backup-service -n aerospike
    ```
    
    ::: note
    You can use a different service account name. Refer to the [ABS CR file](https://aerospike.com/docs/kubernetes/4.4.x/tools/backup/backup-service-configuration) to set the service account name.
    :::
    
2.  Configure S3 backup storage (optional)
    
    ABS supports S3-compatible storage and local storage for backups. If you use S3-compatible storage, add the credentials or roles to the ABS CR file so ABS can connect to the remote storage.
    
    -   [S3 Static Credentials (Kubernetes Secrets)](#tab-panel-3703)
    -   [IAM Roles for Service Accounts (IRSA)](#tab-panel-3704)
    
    Create a Kubernetes secret with the S3 credentials.
    
    Terminal window
    
    ```shell
    kubectl -n aerospike create secret generic aws-secret --from-file=PATH_TO_AWS_CREDENTIALS
    ```
    
    See the [AWS documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) for the format of the credentials file.
    
    Mount the `aws-secret` secret in the ABS pod by adding the `secrets` field in the ABS CR.
    
    ```yaml
    secrets:
    
      - secretName: aws-secret
    
        volumeMount:
    
          name: aws-secret
    
          mountPath: /home/absuser/.aws/credentials
    
          subPath: credentials
    ```
    
    Create and attach an IAM role with the required permissions to the ABS service account `aerospike-backup-service`. Change the service account and role ARN in the following example to the values you created.
    
    Terminal window
    
    ```shell
    kubectl annotate serviceaccount -n aerospike aerospike-backup-service eks.amazonaws.com/role-arn=arn:aws:iam::123456789012:role/MyServiceRole
    ```
    
    See the IRSA documentation for more information on [IAM roles for service accounts](https://docs.aws.amazon.com/eks/latest/userguide/associate-service-account-role.html).
    
3.  Prepare your ABS CR file.
    
    Aerospike publishes sample CR files in the [main Aerospike Kubernetes Operator GitHub repository](https://github.com/aerospike/aerospike-kubernetes-operator/tree/v4.4.1/config/samples).
    
    See [Backup Service Configuration](https://aerospike.com/docs/kubernetes/4.4.x/tools/backup/backup-service-configuration) for details of the available configuration parameters.
    
    Set `spec.image` to a tag from the [Aerospike Backup Service image repository](https://hub.docker.com/r/aerospike/aerospike-backup-service) (for example, `aerospike/aerospike-backup-service:3.5.0`).
    
    You can edit the ABS CR file at any time to manage and change the backup service configuration.
    
4.  Deploy ABS.
    
    Run `kubectl apply` on the CR file you created to deploy ABS.
    
    Terminal window
    
    ```shell
    kubectl apply -f aerospikebackupservice.yaml -n aerospike
    ```
    
5.  Verify ABS status.
    
    Run `kubectl get deployment` to check that AKO has created the ABS deployment.
    
    Terminal window
    
    ```shell
    kubectl get deployment -n aerospike
    ```
    
    ```text
    NAME                            READY   UP-TO-DATE   AVAILABLE   AGE
    
    aerospikebackupservice-sample   1/1     1            1           9s
    ```
    
    Run `kubectl get pods` to check the pods to confirm the status. This step may take time as the pods provision resources, initialize, and become ready. Wait for the pods to switch to the **Running** state before you continue.
    
    Terminal window
    
    ```shell
    kubectl get pods -n aerospike
    ```
    
    ```text
    NAME                                             READY   STATUS    RESTARTS   AGE
    
    aerospikebackupservice-sample-7b7f7b5648-kpfxh   1/1     Running   0          43s
    ```
    

## Next steps

Now that the backup service is running, you can use another CR file to perform a backup or a restore.

See [Backup](https://aerospike.com/docs/kubernetes/4.4.x/tools/backup/backup) and [Restore](https://aerospike.com/docs/kubernetes/4.4.x/tools/backup/restore) for more information.