Configure persistent storage for Splunk Enterprise pods

Set custom storage capacity and Storage Class for Splunk Enterprise pod volumes.

Customize the storage capacity and Storage Class for Splunk Enterprise pod volumes by modifying the custom resource spec.

  1. Modify the etcVolumeStorageConfig and varVolumeStorageConfig fields in your custom resource definition to specify the storage class and capacity.

    The following example sets the /opt/splunk/etc volume to 15 GiB using the gp2 Storage Class, and the /opt/splunk/var volume to 25 GiB using a custom Storage Class:

    CODE
    apiVersion: enterprise.splunk.com/v4
    kind: Standalone
    metadata:
      name: example
      finalizers:
      - enterprise.splunk.com/delete-pvc
    spec:
      etcVolumeStorageConfig:
        storageClassName: gp2
        storageCapacity: 15Gi
      varVolumeStorageConfig:
        storageClassName: customStorageClass
        storageCapacity: 25Gi
  2. Verify which Storage Classes are available in your Kubernetes cluster.
    CODE
    kubectl get storageclass

    Example output:

    CODE
    NAME            PROVISIONER             AGE
    gp2 (default)   kubernetes.io/aws-ebs   176d
  3. Verify the storage allocated to the /opt/splunk/etc and /opt/splunk/var directories on your pod.

    Replace <POD_NAME> with your Splunk pod name.

    CODE
    kubectl exec <POD_NAME> -- df -h

    Example output showing 15 GiB for /opt/splunk/etc and 25 GiB for /opt/splunk/var:

    CODE
    Filesystem      Size  Used Avail Use% Mounted on
    ....
    /dev/nvme2n1     25G  530M   24G   3% /opt/splunk/var
    /dev/nvme1n1     15G  270M   15G   2% /opt/splunk/etc
    ....