Storage#
Warning
This part of the Helm Chart is still influx and may change significantly. Use with caution.
This chapter covers how to attach persistent and ephemeral storage to your application.
Persistence Overview#
All storage is configured under the persistence key. Each entry is a named volume with its own type, mount path, and options. The chart ships with two predefined entries (config and shared), but you can add any number of custom volumes.
Persistent Volume Claims (PVCs)#
Basic PVC#
persistence:
data:
enabled: true
type: pvc
accessMode: ReadWriteOnce
size: 10Gi
mountPath: /data
This creates a PVC named <release>-<chart>-data and mounts it at /data in the main container.
Using a Storage Class#
persistence:
data:
enabled: true
size: 50Gi
storageClass: fast-ssd
mountPath: /data
Set storageClass: "-" to disable dynamic provisioning.
Using an Existing PVC#
Skip PVC creation and bind to an existing claim:
persistence:
data:
enabled: true
existingClaim: my-existing-pvc
mountPath: /data
Sub-Path Mounting#
Mount a specific directory within the volume:
persistence:
data:
enabled: true
existingClaim: shared-volume
subPath: my-app/data
mountPath: /data
Retaining PVCs on Uninstall#
By default, PVCs are deleted when the Helm release is uninstalled. To keep them:
persistence:
data:
enabled: true
size: 10Gi
mountPath: /data
retain: true
This adds helm.sh/resource-policy: keep to the PVC annotations.
Read-Only Volumes#
persistence:
config-files:
enabled: true
existingClaim: config-pvc
mountPath: /etc/app
readOnly: true
emptyDir Volumes#
Ephemeral volumes that exist for the lifetime of the pod. Useful for scratch space or sharing data between containers.
Basic emptyDir#
persistence:
tmp:
enabled: true
type: emptyDir
mountPath: /tmp
RAM-Backed emptyDir#
Mount as a tmpfs (memory-backed) filesystem:
persistence:
cache:
enabled: true
type: emptyDir
medium: Memory
sizeLimit: 256Mi
mountPath: /cache
Shared Volume Between Containers#
The chart includes a built-in shared volume for sharing data between the main container and sidecars:
persistence:
shared:
enabled: true
# type: emptyDir (default)
# mountPath: /shared (default)
All containers (main, init, and additional) can access /shared.
hostPath Volumes#
Mount a file or directory from the host node's filesystem:
persistence:
host-logs:
enabled: true
type: hostPath
hostPath: /var/log/my-app
mountPath: /var/log/my-app
Warning:
hostPathvolumes have security implications and tie your pod to specific nodes. Use with caution.
ConfigMap and Secret Volumes#
Mount a ConfigMap or Secret as files:
persistence:
app-config:
enabled: true
type: configMap
name: my-config-map
mountPath: /etc/app/config
readOnly: true
tls-certs:
enabled: true
type: secret
name: my-tls-secret
mountPath: /etc/tls
readOnly: true
defaultMode: 0400
items:
- key: tls.crt
path: cert.pem
- key: tls.key
path: key.pem
Custom Volumes#
For volume types not covered above, use type: custom with a raw volumeSpec:
persistence:
csi-volume:
enabled: true
type: custom
mountPath: /data
volumeSpec:
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: my-provider
Creating a Volume Without Mounting#
Set mountPath: "-" to create the volume without mounting it to the main container. This is useful when only sidecar containers need the volume:
persistence:
sidecar-only:
enabled: true
type: emptyDir
mountPath: "-"
StatefulSet Volume Claim Templates#
When using application.type: statefulset, you can define per-replica persistent volumes using volumeClaimTemplates:
application:
type: statefulset
replicas: 3
volumeClaimTemplates:
- name: data
mountPath: /data
accessMode: ReadWriteOnce
size: 10Gi
- name: wal
mountPath: /wal
accessMode: ReadWriteOnce
size: 5Gi
storageClass: fast-ssd
Each replica gets its own PVC (e.g., data-my-app-0, data-my-app-1, data-my-app-2).
Custom Volume Name#
Override the auto-generated volume/PVC name suffix:
persistence:
data:
enabled: true
size: 10Gi
mountPath: /data
nameOverride: application-data
The PVC will be named <release>-<chart>-application-data instead of <release>-<chart>-data.
What's Next#
Continue to PostgreSQL to learn how to provision a managed database for your application.