@@ -15,6 +15,7 @@ The **complex** Helm chart provides a comprehensive solution for deploying conta
1515- **ConfigMap integration**: Environment variables and file mounting from ConfigMaps
1616- **Secret integration**: Environment variables and file mounting from Secrets
1717- **Volume mounts**: Mount ConfigMaps and Secrets as files with custom paths
18+ - **Persistent storage**: Create new PVCs or reference existing ones for shared storage (EFS)
1819- **Consumer workloads**: Support for consumer-type deployments
1920- **CronJob support**: Scheduled job execution
2021- **Enterprise features**: Immutable ConfigMaps, custom labels/annotations
@@ -355,6 +356,122 @@ components:
355356 secrets: [] # Empty array = no secret volumes
356357` ` `
357358
359+ ## Persistent Volume Claims
360+
361+ The chart supports creating PersistentVolumeClaims (PVCs) for components that need persistent storage. You can either create a new PVC or reference an existing one to share storage across multiple pods.
362+
363+ ### Creating a New PVC
364+
365+ When ` persistentVolumeClaim` is configured without ` useExistingClaim` , the chart creates a new PVC for the component:
366+
367+ ` ` ` yaml
368+ components:
369+ api:
370+ type: http
371+ persistentVolumeClaim:
372+ size: 10Gi
373+ accessModes:
374+ - ReadWriteOnce
375+ storageClassName: standard
376+ # Optional: Add custom annotations (e.g., for EFS access points)
377+ annotations:
378+ efs.csi.aws.com/access-point-id: "fsap-0123456789abcdef0"
379+ # Optional: Add custom labels
380+ labels:
381+ storage-tier: "premium"
382+ volumeMounts:
383+ others:
384+ - name: data
385+ mountPath: /app/data
386+ readOnly: false
387+ ` ` `
388+
389+ **PVC Properties:**
390+
391+ | Property | Type | Default | Description |
392+ | ----------| ------| ---------| -------------|
393+ | ` size` | string | ` "1Gi"` | Storage size (e.g. , " 1Gi" , " 10Gi" ) |
394+ | ` accessModes` | array | ` ["ReadWriteOnce"]` | Access modes: ` ReadWriteOnce` , ` ReadOnlyMany` , ` ReadWriteMany` , ` ReadWriteOncePod` |
395+ | ` storageClassName` | string | - | Storage class name for the PVC |
396+ | ` annotations` | object | ` {}` | Custom annotations (useful for storage-specific configurations) |
397+ | ` labels` | object | ` {}` | Custom labels |
398+ | ` selector` | object | - | Label selector for binding to specific PVs |
399+ | ` volumeName` | string | - | Name of the PersistentVolume to bind to |
400+
401+ ### Using an Existing PVC
402+
403+ To share storage across multiple pods or reference a PVC created outside the chart, use ` useExistingClaim` :
404+
405+ ` ` ` yaml
406+ components:
407+ api:
408+ type: http
409+ persistentVolumeClaim:
410+ useExistingClaim: true
411+ existingClaimName: "shared-storage-pvc"
412+ volumeMounts:
413+ others:
414+ - name: data
415+ mountPath: /app/data
416+ readOnly: false
417+
418+ worker:
419+ type: consumer
420+ persistentVolumeClaim:
421+ useExistingClaim: true
422+ existingClaimName: "shared-storage-pvc" # Same PVC as api component
423+ volumeMounts:
424+ others:
425+ - name: data
426+ mountPath: /data
427+ readOnly: false
428+ ` ` `
429+
430+ **Benefits of Using Existing PVCs:**
431+
432+ - **Shared storage**: Multiple pods can mount the same PVC (requires ` ReadWriteMany` access mode)
433+ - **Pre-existing storage**: Reference PVCs created manually or by other charts
434+ - **Storage reuse**: Avoid creating duplicate PVCs for the same storage
435+
436+ **Important Notes:**
437+
438+ - When ` useExistingClaim: true` , the chart does **not ** create a PVC - it only references the existing one
439+ - The existing PVC must already exist in the same namespace
440+ - Ensure the PVC's access mode supports your use case (e.g. , ` ReadWriteMany` for multi-pod access)
441+
442+ ### Complete Example
443+
444+ ` ` ` yaml
445+ components:
446+ # Component that creates a new PVC
447+ web:
448+ type: http
449+ persistentVolumeClaim:
450+ size: 5Gi
451+ accessModes:
452+ - ReadWriteMany # Allows multiple pods to mount
453+ storageClassName: efs-sc
454+ annotations:
455+ efs.csi.aws.com/access-point-id: "fsap-0123456789abcdef0"
456+ volumeMounts:
457+ others:
458+ - name: data
459+ mountPath: /usr/share/nginx/html
460+
461+ # Component that uses the existing PVC created above
462+ api:
463+ type: http
464+ persistentVolumeClaim:
465+ useExistingClaim: true
466+ existingClaimName: "my-release-web" # References the PVC created by web component
467+ volumeMounts:
468+ others:
469+ - name: data
470+ mountPath: /app/data
471+ ` ` `
472+
473+ See ` testing-values/values-pvc.yaml` and ` testing-values/values-pvc-efs-shared.yaml` for more examples.
474+
358475## Installation
359476
360477` ` ` bash
@@ -445,6 +562,8 @@ The following complete configuration examples are available in the `testing-valu
445562- [` values-minimal.yaml` ](testing-values/values-minimal.yaml ) - Basic HTTP service
446563- [` values-configmap.yaml` ](testing-values/values-configmap.yaml ) - ConfigMap integration
447564- [` values-volume-mounts.yaml` ](testing-values/values-volume-mounts.yaml ) - Volume mount examples
565+ - [` values-pvc.yaml` ](testing-values/values-pvc.yaml ) - PersistentVolumeClaim examples
566+ - [` values-pvc-efs-shared.yaml` ](testing-values/values-pvc-efs-shared.yaml ) - Shared storage with existing PVCs
448567- [` values-consumer.yaml` ](testing-values/values-consumer.yaml ) - Consumer workloads
449568- [` values-cronjob.yaml` ](testing-values/values-cronjob.yaml ) - Scheduled jobs
450569- [` values-hpa.yaml` ](testing-values/values-hpa.yaml ) - Auto-scaling configuration
0 commit comments