Skip to main content
Loading
Version: Operator 3.4.0

Backup Service

Overviewโ€‹

The Aerospike Backup Service (ABS) reads configurations in a YAML format, which is provided in the ABS Custom Resource (CR) file.

You can deploy the ABS using kubectl or helm.

Requirementsโ€‹

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

1. Prepare the namespaceโ€‹

We recommend using one ABS deployment per Aerospike cluster.

Create the service accountโ€‹

Create the service account for the ABS in the namespace where Aerospike cluster is deployed.

kubectl create serviceaccount aerospike-backup-service -n aerospike

2. Configure S3 backup storage (optional)โ€‹

ABS supports local and S3 compatible storage for backups. If you use S3-compatible storage, provide the S3 credentials or roles to the backup service.

note

ABS does not provision the S3 backend storage. You must provision it and provide the credentials to connect to it.

There are two ways to provide the S3 credentials:

  1. S3 static credentials via Kubernetes secrets:

    • Create a Kubernetes secret with the S3 credentials.

      kubectl -n aerospike create secret generic aws-secret --from-file=</path/to/.aws/credentials>

      Refer to the AWS documentation 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.

      secrets: 
      - secretName: aws-secret
      volumeMount:
      name: aws-secret
      mountPath: /root/.aws/credentials
      subPath: credentials
  2. IAM roles for Service Accounts (IRSA):

    • Create and attach an IAM role with the required permissions to the backup service account aerospike-backup-service.

      Refer to the IRSA documentation for more information on IAM roles for service accounts.

      kubectl annotate serviceaccount -n aerospike aerospike-backup-service eks.amazonaws.com/role-arn=arn:aws:iam::123456789012:role/MyServiceRole

      Change the role ARN to the ARN of the IAM role you created.

    • Set empty s3-profile in the ABS CR file to use the IAM role.

      storage:
      s3Storage:
      type: aws-s3
      path: "s3://test-bucket"
      s3-region: us-east-1
      s3-endpoint-override: ""
      s3-profile: ""

3. Prepare Aerospike Backup Service CR fileโ€‹

See backup service configuration settings for details of the parameters available in the ABS CR file. Find sample ABS CR files in the main Aerospike Kubernetes Operator repository.

You can edit the ABS CR file at any time to manage backups and change the configuration.

4. Deploy the Aerospike Backup Serviceโ€‹

Use the CR file you created to deploy an ABS.

kubectl apply -f aerospikebackupservice.yaml -n aerospike

5. Verify backup service statusโ€‹

Use kubectl get deployment to check that AKO has created the ABS deployment.

$ kubectl get deployment -n aerospike

NAME READY UP-TO-DATE AVAILABLE AGE
aerospikebackupservice-sample 1/1 1 1 9s

Use kubectl get pods to check the pods to confirm the status. This step may take time as the pods provision resources, initialize, and are ready. Wait for the pods to switch to the Running state before you continue.

$ kubectl get pods -n aerospike

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 and Restore for more information.