Skip to content

Commit 32f8b7f

Browse files
liranbgclaude
andcommitted
[mlrun] Support ReadWriteMany access mode when worker replicas > 0
- 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>
1 parent efd6897 commit 32f8b7f

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

stable/mlrun/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
22
name: mlrun
3-
version: 0.11.15
3+
version: 0.11.16
44
appVersion: 1.10.1
55
description: Machine Learning automation and tracking
66
sources:

stable/mlrun/templates/_helpers.tpl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,3 +438,20 @@ Resolve the MLRun DB DSN
438438
{{- printf .Values.httpDB.dsn -}}
439439
{{- end -}}
440440
{{- end -}}
441+
442+
{{/*
443+
Resolve the API persistence access mode
444+
- If accessMode is explicitly set, use it
445+
- Otherwise, infer from worker replicas:
446+
- ReadWriteMany when worker replicas > 0 (multiple pods need shared volume)
447+
- ReadWriteOnce when worker replicas == 0 (single pod)
448+
*/}}
449+
{{- define "mlrun.api.persistence.accessMode" -}}
450+
{{- if .Values.api.persistence.accessMode -}}
451+
{{- printf .Values.api.persistence.accessMode -}}
452+
{{- else if gt (int .Values.api.worker.minReplicas) 0 -}}
453+
{{- print "ReadWriteMany" -}}
454+
{{- else -}}
455+
{{- print "ReadWriteOnce" -}}
456+
{{- end -}}
457+
{{- end -}}

stable/mlrun/templates/mlrun-api-pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
{{- end }}
1212
spec:
1313
accessModes:
14-
- {{ .Values.api.persistence.accessMode | quote }}
14+
- {{ include "mlrun.api.persistence.accessMode" . | quote }}
1515
resources:
1616
requests:
1717
storage: {{ .Values.api.persistence.size | quote }}

stable/mlrun/values.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ api:
6060
enabled: false
6161
existingClaim:
6262
storageClass:
63-
accessMode: "ReadWriteOnce"
63+
# Access mode for the PVC. If empty, automatically inferred:
64+
# - ReadWriteMany when worker.minReplicas > 0 (multiple pods need shared volume)
65+
# - ReadWriteOnce when worker.minReplicas == 0 (single pod)
66+
# If explicitly set, the provided value is used regardless of worker count.
67+
accessMode: ""
6468
size: "8Gi"
6569
annotations: ~
6670

0 commit comments

Comments
 (0)