Loading
Version: Operator 3.4.0Add a Shadow Device to Aerospike on Kubernetes
Overview
You can configure the namespace storage engine in cloud environments to use extremely high-performance cloud-instance-attached local SSDs. Under this setup, writes are duplicated to another network-attached shadow device for persistence in case the cloud instance terminates.
Setup
- Follow the instructions in our storage provisioning guide to create a local volume provisioner and appropriate storage class.
For more information on using a shadow device and other storage configurations, see Namespace Storage Configuration.
- Add the following storage-specific configuration to the Aerospike cluster's custom resource (CR) file.
storage:
filesystemVolumePolicy:
cascadeDelete: true
initMethod: deleteFiles
blockVolumePolicy:
cascadeDelete: true
volumes:
- name: workdir
aerospike:
path: /opt/aerospike
source:
persistentVolume:
storageClass: ssd
volumeMode: Filesystem
size: 1Gi
- name: nsvol1
aerospike:
path: /dev/nvme0n1
source:
persistentVolume:
storageClass: local-ssd
volumeMode: Block
size: 5Gi
- name: nsvol2
aerospike:
path: /dev/sdf
source:
persistentVolume:
storageClass: ssd
volumeMode: Block
size: 5Gi
- name: aerospike-config-secret
source:
secret:
secretName: aerospike-secret
aerospike:
path: /etc/aerospike/secret
.
.
.
aerospikeConfig:
service:
feature-key-file: /etc/aerospike/secret/features.conf
security: {}
namespaces:
- name: test
replication-factor: 2
storage-engine:
type: device
devices:
- /dev/nvme0n1 /dev/sdf
For the full CR file, see the example shadow device cluster CR.
This and other example CRs are available in the main Aerospike Kubernetes Operator repository.
- Save and exit the CR file, then use
kubectl
to apply the change.
kubectl apply -f aerospike-cluster.yaml