Skip to content

Commit

Permalink
Add option for dynamically provisioned persistent volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
esteinerMW committed Dec 27, 2024
1 parent c2fb1be commit 7b91789
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
12 changes: 10 additions & 2 deletions releases/R2025a/matlab-prodserver/templates/mps-3-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
runAsNonRoot: true
runAsUser: 1001
runAsGroup: 1001
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
fsGroup: 1001
{{- end }}

containers:
- name: mps
Expand Down Expand Up @@ -130,12 +133,17 @@ spec:
name: matlab-production-server-config
- name: auto-deploy
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
{{- if ne .Values.matlabProductionServerSettings.autoDeploy.archivesApi.rwxClaimName "" }}
# Valid options when archives API is enabled: createPVC: true / volumeType: pvc / empty
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
persistentVolumeClaim:
claimName: dynamic-auto-deploy
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "pvc" }}
persistentVolumeClaim:
claimName: {{ .Values.matlabProductionServerSettings.autoDeploy.archivesApi.rwxClaimName }}
claimName: {{ .Values.matlabProductionServerSettings.autoDeploy.claimName }}
{{ else }}
emptyDir: {}
{{- end }}
# Valid options for predef static volume: hostpath / nfs / pvc / azurefileshare / empty
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "hostpath" }}
hostPath:
path: {{ .Values.matlabProductionServerSettings.autoDeploy.hostpath }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dynamic-auto-deploy
namespace: {{ .Release.Namespace }}
labels:
app: mps
release: {{ .Release.Name }}
spec:
accessModes:
- {{ .Values.matlabProductionServerSettings.autoDeploy.archivesApi.accessMode | default "ReadWriteOnce" }}
volumeMode: Filesystem
storageClassName: {{ .Values.matlabProductionServerSettings.autoDeploy.archivesApi.storageClassName | default "" }}
resources:
requests:
storage: {{ .Values.matlabProductionServerSettings.autoDeploy.archivesApi.size | default "4Gi" | quote }}
{{ end }}
6 changes: 4 additions & 2 deletions releases/R2025a/matlab-prodserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ matlabProductionServerSettings:
# Enable RESTful API for management of CTF 'Deployable Archives'
archivesApi:
enabled: false
# Persistent-Volume-Claim name (ReadWriteMany accessMode)
rwxClaimName: ""
createPVC: false
storageClassName: ""
accessMode: ReadWriteOnce
size: "4Gi"
# _OR_
# Inline mount options: hostpath, nfs, pvc, azurefileshare, empty (default)
volumeType: "empty"
Expand Down
8 changes: 6 additions & 2 deletions values-overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ matlabProductionServerSettings:
# Enable RESTful API for management of CTF 'Deployable Archives'
archivesApi: # Since R2025a
enabled: false
# Persistent-Volume-Claim name (ReadWriteMany accessMode)
rwxClaimName: ""
createPVC: false # When dynamic volume provisioning is enabled.
storageClassName: ""
accessMode: ReadWriteOnce # ReadWriteMany when replicaCount > 1
size: "4Gi"
# _OR_
# Inline mount options: hostpath, nfs, pvc, azurefileshare, empty (default)
# Note: archives API is supported with pvc and empty volume types.
volumeType: "empty"
# Node mount dir, example: /mnt/share/autodeploy
hostpath: ""
Expand All @@ -47,6 +50,7 @@ matlabProductionServerSettings:
path: ""
# =================================================================
# Persistent-Volume-Claim name, example: autodeploy-pv-claim
# If archives API is enabled, PVC Access-Mode should be RWO or RWX.
claimName: ""
# =================================================================
# Azure storage account file share name, example: auto-deploy-share
Expand Down

0 comments on commit 7b91789

Please sign in to comment.