Skip to content

[mlrun] Support ReadWriteMany access mode when worker replicas > 0#1133

Merged
liranbg merged 1 commit intov3io:developmentfrom
liranbg:mlrun-rwx
Feb 16, 2026
Merged

[mlrun] Support ReadWriteMany access mode when worker replicas > 0#1133
liranbg merged 1 commit intov3io:developmentfrom
liranbg:mlrun-rwx

Conversation

@liranbg
Copy link
Collaborator

@liranbg liranbg commented Feb 16, 2026

Summary

This PR adds automatic ReadWriteMany (RWX) access mode configuration for MLRun API PVC based on worker replica count, with support for explicit override.

Changes

  • Added mlrun.api.persistence.accessMode helper function in _helpers.tpl that dynamically determines the PVC access mode
  • Updated mlrun-api-pvc.yaml to use the new helper function
  • Updated values.yaml to set accessMode to empty string by default (enabling automatic inference)
  • Added comprehensive documentation explaining the behavior
  • Bumped chart version to 0.11.16

Behavior

The access mode is determined by the following logic:

  1. If accessMode is explicitly set: Use the provided value (regardless of worker count)
  2. Else if worker.minReplicas > 0: Automatically use ReadWriteMany to allow both chief and worker pods to share the volume
  3. Else: Automatically use ReadWriteOnce for single pod deployments

This provides flexibility - users can either:

  • Leave accessMode empty for automatic inference based on worker count (recommended)
  • Explicitly set accessMode to override the automatic behavior when needed

Testing

Verified all scenarios with helm template:

  • ✅ Empty accessMode + 0 workers → ReadWriteOnce (inferred)
  • ✅ Empty accessMode + 2 workers → ReadWriteMany (inferred)
  • ✅ Explicit ReadWriteMany + 0 workers → ReadWriteMany (explicit overrides)
  • ✅ Explicit ReadWriteOnce + 2 workers → ReadWriteOnce (explicit overrides)

related to https://iguazio.atlassian.net/browse/IG4-1236

- Add helper function to automatically set PVC access mode to ReadWriteMany when api.worker.minReplicas > 0
- This allows both chief and worker pods to share the same volume
- Falls back to configured accessMode (default: ReadWriteOnce) when no workers are deployed
- Bump chart version to 0.11.16

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds intelligent PVC access mode configuration for the MLRun API based on worker replica count, enabling automatic ReadWriteMany mode when multiple pods need to share the volume.

Changes:

  • Added mlrun.api.persistence.accessMode helper function that dynamically determines PVC access mode based on worker count
  • Updated PVC template to use the new helper function instead of direct value reference
  • Changed default accessMode to empty string in values.yaml to enable automatic inference

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
stable/mlrun/Chart.yaml Bumped chart version from 0.11.15 to 0.11.16
stable/mlrun/templates/_helpers.tpl Added helper function to determine access mode: ReadWriteMany when workers > 0, ReadWriteOnce otherwise, with explicit override support
stable/mlrun/templates/mlrun-api-pvc.yaml Updated to use new helper function for access mode determination
stable/mlrun/values.yaml Changed default accessMode to empty string with comprehensive documentation explaining automatic inference behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@liranbg liranbg merged commit 182ee9c into v3io:development Feb 16, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants