You can mount one or more Persistent Volume Claims (PVCs) directly to your Hazelcast cluster.
Each PVC defined in the persistenceVolumeClaims section will be mounted under the path /data/<name-of-pvc>. This allows you to use PVCs for any Hazelcast feature that requires persistent storage by referencing the PVC name. It also decouples the PVC definition from feature configuration, making it easier to manage and reuse storage across different Hazelcast features.
Configure a PVC
-
Define one or more PVCs in the
persistenceVolumeClaimssection of your Hazelcast custom resource (CR). -
Each PVC will be mounted at
/data/<name>, where<name>is the value of the name field in your PVC configuration. -
Features that require persistent storage (such as diagnostics, persistence, or the CP Subsystem) can reference the PVC by specifying its in the appropriate field (e.g.
pvcName).
For more information, see the API. For a tutorial on enabling persistence, see Persist map entries on disk.
Example: Configure diagnostics with a named PVC
The following example configuration shows how to define a PVC and use it for diagnostics logging by specifying the pvcName field. The diagnostics logs will be stored in the PVC mounted at /data/diagnostics-pvc-volume.
apiVersion: hazelcast.com/v1alpha1
kind: Hazelcast
metadata:
name: hazelcast
spec:
clusterSize: 3
repository: 'docker.io/hazelcast/hazelcast-enterprise'
version: 5.6.0-SNAPSHOT
licenseKeySecretName: hazelcast-license-key
diagnostics:
outputType: STDOUT
maxRolledFileCount: 10
maxRolledFileSize: '50M'
pvcName: diagnostics-pvc-volume
persistenceVolumeClaims:
- accessModes: [ "ReadWriteOnce" ]
requestStorage: 1Gi
storageClassName: "standard"
name: diagnostics-pvc-volume