diff --git a/stable/mlrun/Chart.yaml b/stable/mlrun/Chart.yaml index 769073433..74d27a2a3 100644 --- a/stable/mlrun/Chart.yaml +++ b/stable/mlrun/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: mlrun -version: 0.11.15 +version: 0.11.16 appVersion: 1.10.1 description: Machine Learning automation and tracking sources: diff --git a/stable/mlrun/templates/_helpers.tpl b/stable/mlrun/templates/_helpers.tpl index 71135fdab..8a3b3b03e 100644 --- a/stable/mlrun/templates/_helpers.tpl +++ b/stable/mlrun/templates/_helpers.tpl @@ -438,3 +438,20 @@ Resolve the MLRun DB DSN {{- printf .Values.httpDB.dsn -}} {{- end -}} {{- end -}} + +{{/* +Resolve the API persistence access mode +- If accessMode is explicitly set, use it +- Otherwise, infer from worker replicas: + - ReadWriteMany when worker replicas > 0 (multiple pods need shared volume) + - ReadWriteOnce when worker replicas == 0 (single pod) +*/}} +{{- define "mlrun.api.persistence.accessMode" -}} + {{- if .Values.api.persistence.accessMode -}} + {{- printf .Values.api.persistence.accessMode -}} + {{- else if gt (int .Values.api.worker.minReplicas) 0 -}} + {{- print "ReadWriteMany" -}} + {{- else -}} + {{- print "ReadWriteOnce" -}} + {{- end -}} +{{- end -}} diff --git a/stable/mlrun/templates/mlrun-api-pvc.yaml b/stable/mlrun/templates/mlrun-api-pvc.yaml index a10eb933c..cf74ad1fc 100644 --- a/stable/mlrun/templates/mlrun-api-pvc.yaml +++ b/stable/mlrun/templates/mlrun-api-pvc.yaml @@ -11,7 +11,7 @@ metadata: {{- end }} spec: accessModes: - - {{ .Values.api.persistence.accessMode | quote }} + - {{ include "mlrun.api.persistence.accessMode" . | quote }} resources: requests: storage: {{ .Values.api.persistence.size | quote }} diff --git a/stable/mlrun/values.yaml b/stable/mlrun/values.yaml index 244a9066b..48c38c2cb 100644 --- a/stable/mlrun/values.yaml +++ b/stable/mlrun/values.yaml @@ -60,7 +60,11 @@ api: enabled: false existingClaim: storageClass: - accessMode: "ReadWriteOnce" + # Access mode for the PVC. If empty, automatically inferred: + # - ReadWriteMany when worker.minReplicas > 0 (multiple pods need shared volume) + # - ReadWriteOnce when worker.minReplicas == 0 (single pod) + # If explicitly set, the provided value is used regardless of worker count. + accessMode: "" size: "8Gi" annotations: ~