---
title: "HDD storage configuration with data in memory for Aerospike on Kubernetes"
description: "Configure HDD storage with data-in-memory for Aerospike on Kubernetes using YAML Custom Resource files."
---

# HDD storage configuration with data in memory for Aerospike on Kubernetes

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/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 setting up HDD storage with data-in-memory and other storage configurations, [see the Aerospike documentation for namespace storage configuration](https://aerospike.com/docs/database/manage/namespace/storage/config).

## Configure HDD storage

1.  Add the following storage-specific configuration to the Aerospike cluster’s CR file.
    
    ```yaml
    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: ns
    
            aerospike:
    
              path: /opt/aerospike/data
    
            source:
    
              persistentVolume:
    
                storageClass: ssd
    
                volumeMode: Filesystem
    
                size: 3Gi
    
          - 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: memory
    
              files:
    
                - /opt/aerospike/data/test.dat
    
              filesize: 2000000000
    ```
    
    For the full CR file, see the [example HDD storage with data-in-memory cluster CR](https://github.com/aerospike/aerospike-kubernetes-operator/blob/v4.4.1/config/samples/hdd_dim_storage_cluster_cr.yaml).
    
    This and other example CRs are available in [the main Aerospike Kubernetes Operator repository](https://github.com/aerospike/aerospike-kubernetes-operator/tree/v4.4.1/config/samples).
    
2.  Save and exit the CR file, then use `kubectl` to apply the change.
    
    Terminal window
    
    ```shell
    kubectl apply -f aerospike-cluster.yaml
    ```