Skip to content

Commit 7b91789

Browse files
committed
Add option for dynamically provisioned persistent volumes
1 parent c2fb1be commit 7b91789

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

releases/R2025a/matlab-prodserver/templates/mps-3-deployment.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ spec:
3030
runAsNonRoot: true
3131
runAsUser: 1001
3232
runAsGroup: 1001
33+
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
34+
fsGroup: 1001
35+
{{- end }}
3336

3437
containers:
3538
- name: mps
@@ -130,12 +133,17 @@ spec:
130133
name: matlab-production-server-config
131134
- name: auto-deploy
132135
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
133-
{{- if ne .Values.matlabProductionServerSettings.autoDeploy.archivesApi.rwxClaimName "" }}
136+
# Valid options when archives API is enabled: createPVC: true / volumeType: pvc / empty
137+
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
138+
persistentVolumeClaim:
139+
claimName: dynamic-auto-deploy
140+
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "pvc" }}
134141
persistentVolumeClaim:
135-
claimName: {{ .Values.matlabProductionServerSettings.autoDeploy.archivesApi.rwxClaimName }}
142+
claimName: {{ .Values.matlabProductionServerSettings.autoDeploy.claimName }}
136143
{{ else }}
137144
emptyDir: {}
138145
{{- end }}
146+
# Valid options for predef static volume: hostpath / nfs / pvc / azurefileshare / empty
139147
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "hostpath" }}
140148
hostPath:
141149
path: {{ .Values.matlabProductionServerSettings.autoDeploy.hostpath }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{ if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: dynamic-auto-deploy
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
app: mps
9+
release: {{ .Release.Name }}
10+
spec:
11+
accessModes:
12+
- {{ .Values.matlabProductionServerSettings.autoDeploy.archivesApi.accessMode | default "ReadWriteOnce" }}
13+
volumeMode: Filesystem
14+
storageClassName: {{ .Values.matlabProductionServerSettings.autoDeploy.archivesApi.storageClassName | default "" }}
15+
resources:
16+
requests:
17+
storage: {{ .Values.matlabProductionServerSettings.autoDeploy.archivesApi.size | default "4Gi" | quote }}
18+
{{ end }}

releases/R2025a/matlab-prodserver/values.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ matlabProductionServerSettings:
2929
# Enable RESTful API for management of CTF 'Deployable Archives'
3030
archivesApi:
3131
enabled: false
32-
# Persistent-Volume-Claim name (ReadWriteMany accessMode)
33-
rwxClaimName: ""
32+
createPVC: false
33+
storageClassName: ""
34+
accessMode: ReadWriteOnce
35+
size: "4Gi"
3436
# _OR_
3537
# Inline mount options: hostpath, nfs, pvc, azurefileshare, empty (default)
3638
volumeType: "empty"

values-overrides.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ matlabProductionServerSettings:
3333
# Enable RESTful API for management of CTF 'Deployable Archives'
3434
archivesApi: # Since R2025a
3535
enabled: false
36-
# Persistent-Volume-Claim name (ReadWriteMany accessMode)
37-
rwxClaimName: ""
36+
createPVC: false # When dynamic volume provisioning is enabled.
37+
storageClassName: ""
38+
accessMode: ReadWriteOnce # ReadWriteMany when replicaCount > 1
39+
size: "4Gi"
3840
# _OR_
3941
# Inline mount options: hostpath, nfs, pvc, azurefileshare, empty (default)
42+
# Note: archives API is supported with pvc and empty volume types.
4043
volumeType: "empty"
4144
# Node mount dir, example: /mnt/share/autodeploy
4245
hostpath: ""
@@ -47,6 +50,7 @@ matlabProductionServerSettings:
4750
path: ""
4851
# =================================================================
4952
# Persistent-Volume-Claim name, example: autodeploy-pv-claim
53+
# If archives API is enabled, PVC Access-Mode should be RWO or RWX.
5054
claimName: ""
5155
# =================================================================
5256
# Azure storage account file share name, example: auto-deploy-share

0 commit comments

Comments
 (0)