fluid icon indicating copy to clipboard operation
fluid copied to clipboard

[FEATURES] Feature Request: Support for volumeClaimTemplates in JuiceFSRuntime

Open oldthreefeng opened this issue 5 months ago • 2 comments

What feature you'd like to add: I would like JuiceFSRuntime to support volumeClaimTemplates, similar to how StatefulSets in Kubernetes use volumeClaimTemplates to dynamically provision persistent storage volumes for each replica.

Why is this feature needed: Currently, it is not possible to dynamically create and manage PVCs for each JuiceFSRuntime pod. Adding support for volumeClaimTemplates would enable more flexible and automated storage management, especially for use cases where each runtime requires its own persistent storage (e.g. scratch space, cache, or datasets that should not be shared). This feature can greatly improve scalability, manageability, and compliance with Kubernetes storage best practices.

Additional context:

Reference: StatefulSet volumeClaimTemplates documentation This would help facilitate dynamic provisioning with various StorageClasses according to user workloads. It would make JuiceFSRuntime better suited for cloud-native and multi-tenant environments.

oldthreefeng avatar Aug 01 '25 09:08 oldthreefeng

@oldthreefeng Thanks for the feature request! I think it should be a feature on our plan. cc @cheyang @zwwhdls

A workaround that may help you now would be using the ephemeral storage.

For example:

apiVersion: data.fluid.io/v1alpha1
kind: JuiceFSRuntime
metadata:
  name: jfsdemo
spec:
  replicas: 1
  volumes:
  - name: datacache-vol
    ephemeral:
      volumeClaimTemplate:
        spec:
          accessModes: [ "ReadWriteOnce" ]
          storageClassName: <storage_class_name>
          resources:
            requests:
              storage: 30Gi
  worker:
    volumeMounts:
      - mountPath: /var/run/juicefs/cache
        name: datacache-vol
  tieredstore:
    levels:
      - mediumtype: SSD
        volumeType: emptyDir
        path: /var/run/juicefs/cache
        quota: 30Gi
        low: "0.1"

TrafalgarZZZ avatar Aug 07 '25 05:08 TrafalgarZZZ

@TrafalgarZZZ thanks for you reply~ .

oldthreefeng avatar Aug 07 '25 05:08 oldthreefeng