Skip to content

feat(juicefs): support worker volumeClaimTemplates#5862

Open
CAICAIIs wants to merge 12 commits into
fluid-cloudnative:masterfrom
CAICAIIs:issue-5191
Open

feat(juicefs): support worker volumeClaimTemplates#5862
CAICAIIs wants to merge 12 commits into
fluid-cloudnative:masterfrom
CAICAIIs:issue-5191

Conversation

@CAICAIIs
Copy link
Copy Markdown
Contributor

@CAICAIIs CAICAIIs commented May 12, 2026

Ⅰ. Describe what this PR does

Support volumeClaimTemplates for JuiceFS worker StatefulSet.

This PR adds spec.volumeClaimTemplates to JuiceFSRuntime, passes it through JuiceFS value generation, and renders it into the worker StatefulSet. Worker volumeMounts can now reference either regular spec.volumes or spec.volumeClaimTemplates.

It also validates invalid worker volume configurations early:

  • fails when a worker volumeMount cannot be resolved from either volumes or volumeClaimTemplates
  • fails when a declared volumeClaimTemplate is not mounted by the worker
  • rejects volumeClaimTemplates changes after the worker StatefulSet has been created, because StatefulSet volumeClaimTemplates are immutable

Ⅱ. Does this pull request fix one issue?

Fixes #5191

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Added unit coverage for:

  • worker volume mounts backed by volumeClaimTemplates
  • unresolved worker volume mounts
  • unmounted worker volumeClaimTemplates
  • duplicate worker mounts referencing the same normal volume or claim template
  • same-name normal volume and claim template precedence
  • transform error propagation
  • immutable worker volumeClaimTemplates sync behavior

Ⅳ. Describe how to verify it

go test ./pkg/ddc/juicefs -count=1 -v
make update-crd
make gen-openapi
helm lint charts/juicefs
helm lint charts/fluid/fluid

Also verified Helm rendering:

helm template test charts/juicefs \
  --set worker.enabled=true \
  --set 'worker.volumeClaimTemplates[0].metadata.name=cache' \
  --set 'worker.volumeClaimTemplates[0].spec.accessModes[0]=ReadWriteOnce' \
  --set 'worker.volumeClaimTemplates[0].spec.resources.requests.storage=1Gi'

CAICAIIs added 10 commits May 12, 2026 23:49
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented May 12, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zwwhdls for approval by writing /assign @zwwhdls in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented May 12, 2026

Hi @CAICAIIs. Thanks for your PR.

I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for volumeClaimTemplates in the JuiceFSRuntime worker StatefulSet, enabling dynamic volume provisioning for JuiceFS workers. The changes encompass API and CRD updates, Helm chart modifications, and documentation revisions. The engine logic has been enhanced to manage the transformation of these templates and enforce their immutability during runtime synchronization. Furthermore, the testing suite underwent significant refactoring to replace gomonkey patching with function-based mocking, improving test stability and maintainability. I have no feedback to provide as there were no review comments to assess.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.14%. Comparing base (813d429) to head (3b10977).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5862      +/-   ##
==========================================
+ Coverage   59.10%   59.14%   +0.04%     
==========================================
  Files         480      480              
  Lines       32512    32538      +26     
==========================================
+ Hits        19215    19244      +29     
+ Misses      11747    11745       -2     
+ Partials     1550     1549       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

CAICAIIs added 2 commits May 13, 2026 02:05
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURES] Feature Request: Support for volumeClaimTemplates in JuiceFSRuntime

1 participant