Persistent Volume Claim

This is probably the most common storage type, therefore it is also the default when no type is specified.

It can be attached in two ways.

Dynamically provisioned

Charts can be configured to create the required persistentVolumeClaim manifests on the fly.

FieldMandatoryDocs / Description
enabledYes
typeYes
accessModeYeslink
sizeYeslink
mountPathNoWhere to mount the volume in the main container. Defaults to /<name_of_the_volume>.
readOnlyNoSpecify if the volume should be mounted read-only.
nameOverrideNoOverride the name suffix that is used for this volume.
storageClassNoStorage class to use for this volume.
retainNoSet to true to retain the PVC upon helm uninstall.

Minimal configuration:

persistence:
  config:
    enabled: true
    type: pvc
    accessMode: ReadWriteOnce
    size: 1Gi

This will create a 1Gi RWO PVC named RELEASE-NAME-config with the default storageClass, which will mount to /config.

Existing claim

Charts can be configured to attach to a pre-existing persistentVolumeClaim.

FieldMandatoryDocs / Description
enabledYes
typeYes
existingClaimYesName of the existing PVC
mountPathNoWhere to mount the volume in the main container. Defaults to /<name_of_the_volume>.
subPathNoSpecifies a sub-path inside the referenced volume instead of its root.
readOnlyNoSpecify if the volume should be mounted read-only.
nameOverrideNoOverride the name suffix that is used for this volume.

Minimal configuration:

persistence:
  config:
    enabled: true
    type: pvc
    existingClaim: myAppData

This will mount an existing PVC named myAppData to /config.