Data in memory with file persistence for Aerospike on Kubernetes
For the complete documentation index see: llms.txt
All documentation pages available in markdown.
This example lets you store namespace data both in memory and on the persistent device. For more information on data in memory with persistence and other storage configurations, see the Aerospike documentation for namespace storage configuration.
The ns volume in the following example holds the persistence file.
Its StorageClass must be backed by local storage or by a dedicated network block volume, such as one from the Amazon EBS CSI driver.
Don’t use a StorageClass backed by shared storage, such as Ceph through Rook. See Non-local storage.
Configure file persistence
-
Add the following storage-specific configuration to the Aerospike cluster’s CR file.
storage:filesystemVolumePolicy:cascadeDelete: trueinitMethod: deleteFilesblockVolumePolicy:cascadeDelete: truevolumes:- name: workdiraerospike:path: /opt/aerospikesource:persistentVolume:storageClass: ssdvolumeMode: Filesystemsize: 1Gi- name: nsaerospike:path: /opt/aerospike/datasource:persistentVolume:storageClass: ssdvolumeMode: Filesystemsize: 3Gi- name: aerospike-config-secretsource:secret:secretName: aerospike-secretaerospike:path: /etc/aerospike/secret...aerospikeConfig:service:feature-key-file: /etc/aerospike/secret/features.confsecurity: {}namespaces:- name: testreplication-factor: 2storage-engine:type: memoryfiles:- /opt/aerospike/data/test.datfilesize: 2000000000For the full CR file, see the example data-in-memory cluster CR with file persistence.
This and other example CRs are available in the main Aerospike Kubernetes Operator repository.
-
Save and exit the CR file, then use
kubectlto apply the change.Terminal window kubectl apply -f aerospike-cluster.yaml