Skip to content

Commit 319ecba

Browse files
committed
R2025b Initial commit
1 parent 6828baa commit 319ecba

File tree

9 files changed

+252
-90
lines changed

9 files changed

+252
-90
lines changed

.github/workflows/helm-chart.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
- Helm_artifacts
88

99
env:
10-
HELM_CHART_VERSION: 1.2.0
11-
MATLAB_APP_VERSION: "R2025a"
10+
HELM_CHART_VERSION: 1.3.0
11+
MATLAB_APP_VERSION: "R2025b"
1212

1313
jobs:
1414
release-helm-chart:

releases/R2022b/matlab-prodserver/values.yaml

Lines changed: 0 additions & 75 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
appVersion: "R2022b"
2+
appVersion: "R2025b"
33
description: MATLAB Production Server Helm chart for Kubernetes
44
name: matlab-prodserver-k8s
5-
version: 0.1.2
5+
version: 1.3.0
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Chart validation checks:
2+
3+
{{- define "checkConditionReplicaCount" -}}
4+
{{- if and (gt (int .Values.deploymentSettings.replicaCount) 1) .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
5+
{{- if ne .Values.matlabProductionServerSettings.autoDeploy.archivesApi.accessMode "ReadWriteMany" }}
6+
{{- fail "Configuring multiple replicas requires PVC with ReadWriteMany Access-Mode." }}
7+
{{- end }}
8+
{{- end }}
9+
{{- end }}
10+
11+
{{- define "checkConditionVolumeType" -}}
12+
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
13+
{{- $volumeType := .Values.matlabProductionServerSettings.autoDeploy.volumeType }}
14+
{{- if and (ne $volumeType "pvc") (ne $volumeType "empty") }}
15+
{{- fail "Configuring archives API is only supported with pvc or empty volume types." }}
16+
{{- end }}
17+
{{- end }}
18+
{{- end }}

releases/R2022b/matlab-prodserver/templates/mps-1-service-ingress.yaml renamed to releases/R2025b/matlab-prodserver/templates/mps-1-service-ingress.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ spec:
1919
type: ClusterIP
2020

2121
---
22+
{{- if .Values.global.ingressController.enabled }}
2223
apiVersion: networking.k8s.io/v1
2324
kind: Ingress
2425
metadata:
@@ -35,6 +36,15 @@ metadata:
3536
{{ end }}
3637
spec:
3738
ingressClassName: {{ .Values.global.ingressController.name }}
39+
{{ if .Values.global.ingressController.tls.enabled }}
40+
tls:
41+
- hosts:
42+
- {{ .Values.global.ingressController.domainBase }}
43+
{{- if .Values.global.ingressController.tls.secretName }}
44+
secretName: {{ .Values.global.ingressController.tls.secretName }}
45+
{{- end }}
46+
{{ end }}
47+
3848
rules:
3949
- host: {{ .Values.global.ingressController.domainBase }}
4050
http:
@@ -46,6 +56,7 @@ spec:
4656
name: matlab-production-server
4757
port:
4858
number: 9910
59+
{{- end }}
4960

5061
---
5162
{{ if and (.Values.optionalSettings.Prometheus.enabled) (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }}

releases/R2022b/matlab-prodserver/templates/mps-2-configmap.yaml renamed to releases/R2025b/matlab-prodserver/templates/mps-2-configmap.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ data:
99
main_config: |
1010
--http 9910
1111
--ssl-verify-peer-mode no-verify-peer
12-
--ssl-protocols TLSv1.1,TLSv1.2
12+
--ssl-protocols TLSv1.2,TLSv1.3
1313
--ssl-ciphers ALL
1414
--mcr-root /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}
1515
--num-workers {{ .Values.matlabProductionServerSettings.numWorkers | default 1 }}
@@ -24,7 +24,7 @@ data:
2424
--log-rotation-size 100MB
2525
--log-archive-root ./old_logs
2626
--log-archive-max-size 1GB
27-
--log-root ./log
27+
{{ ternary "--log-root ./log" "" .Values.matlabProductionServerSettings.localFileLogging }}
2828
--log-stdout
2929
--license {{ .Values.global.licenseServer | default "27000@hostname" }}
3030
--license-grace-period 2:30
@@ -42,7 +42,17 @@ data:
4242
--server-memory-threshold-overflow-action purge_responses
4343
--enable-discovery
4444
--enable-metrics
45+
{{ ternary "--enable-archive-management" "" .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
4546
--routes-file ./config/routes.json
47+
{{- if .Values.matlabProductionServerSettings.accessControl.enabled }}
48+
--access-control-provider OAuth2
49+
--access-control-config ./config/jwt_idp.json
50+
--access-control-policy ./config/ac_policy.json
51+
52+
jwt_idp.json: {{ .Values.matlabProductionServerSettings.accessControl.identityProvider | quote }}
53+
54+
ac_policy.json: {{ .Values.matlabProductionServerSettings.accessControl.policyRules | quote }}
55+
{{- end }}
4656

4757
{{- if .Values.optionalSettings.Redis.host }}
4858
mps_cache_config: |

releases/R2022b/matlab-prodserver/templates/mps-3-deployment.yaml renamed to releases/R2025b/matlab-prodserver/templates/mps-3-deployment.yaml

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#
22
# MATLAB Production Server instance
33
#
4+
{{- include "checkConditionVolumeType" . }}
5+
{{- include "checkConditionReplicaCount" . }}
6+
47
apiVersion: apps/v1
58
kind: Deployment
69
metadata:
@@ -19,6 +22,7 @@ spec:
1922
labels:
2023
app: mps
2124
annotations:
25+
checksum/config: {{ include (print $.Template.BasePath "/mps-2-configmap.yaml") . | sha256sum }}
2226
{{ if not .Values.optionalSettings.Prometheus.enabled }}
2327
prometheus.io/scrape: 'true'
2428
prometheus.io/path: '/api/metrics'
@@ -27,19 +31,29 @@ spec:
2731
spec:
2832
securityContext:
2933
runAsNonRoot: true
30-
runAsUser: 1000
31-
runAsGroup: 1000
34+
runAsUser: 1001
35+
runAsGroup: 1001
36+
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
37+
fsGroup: 1001
38+
{{- end }}
3239

3340
containers:
3441
- name: mps
35-
image: {{ .Values.images.productionServer.registry }}/{{ .Values.images.productionServer.repository }}:{{ .Values.images.productionServer.tag }}
42+
image: {{ .Values.global.images.registry | default .Values.images.productionServer.registry }}/{{ .Values.images.productionServer.repository }}:{{ .Values.images.productionServer.tag }}
3643
env:
3744
- name: AGREE_TO_MATHWORKS_SOFTWARE_LICENSE
38-
value: {{ .Values.global.agreeToLicense | default "no" | lower | quote }}
45+
value: {{ required "agreeToLicense must be set to \"yes\"." .Values.global.agreeToLicense | default "no" | lower | quote }}
3946
- name: AGREE_TO_MATLAB_RUNTIME_LICENSE
40-
value: {{ .Values.global.agreeToLicense | default "no" | lower | quote }}
47+
value: {{ required "agreeToLicense must be set to \"yes\"." .Values.global.agreeToLicense | default "no" | lower | quote }}
4148
- name: LD_LIBRARY_PATH
4249
value: "/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/runtime/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/bin/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/sys/os/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/extern/bin/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/sys/opengl/lib/glnxa64"
50+
{{ if .Values.optionalSettings.Redis.secretName }}
51+
- name: MPS_REDIS_PASSWORD
52+
valueFrom:
53+
secretKeyRef:
54+
name: {{ .Values.optionalSettings.Redis.secretName }}
55+
key: {{ .Values.optionalSettings.Redis.secretKey | default "redis-password" }}
56+
{{ end }}
4357

4458
ports:
4559
- containerPort: 9910
@@ -65,7 +79,7 @@ spec:
6579
command:
6680
- ls
6781
- /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/matlabruntime_license_agreement.pdf
68-
initialDelaySeconds: 30
82+
initialDelaySeconds: 10
6983
periodSeconds: 30
7084

7185
livenessProbe:
@@ -84,13 +98,18 @@ spec:
8498

8599
initContainers:
86100
- name: matlab-runtime
87-
image: {{ .Values.images.matlabRuntime.registry }}/{{ .Values.images.matlabRuntime.repository }}:{{ .Values.images.matlabRuntime.tag }}
101+
image: {{ .Values.global.images.registry | default .Values.images.matlabRuntime.registry }}/{{ .Values.images.matlabRuntime.repository }}:{{ .Values.images.matlabRuntime.tag }}
88102

89103
command:
90104
- /bin/sh
91105
- -c
92106
- "cp -r /opt/matlabruntime/* /mnt/"
93107

108+
resources:
109+
limits:
110+
cpu: "1"
111+
memory: "4Gi"
112+
94113
volumeMounts:
95114
- name: mcr-root
96115
mountPath: "/mnt"
@@ -99,10 +118,13 @@ spec:
99118

100119
restartPolicy: {{ .Values.deploymentSettings.restartPolicy }}
101120
imagePullSecrets:
121+
{{- if .Values.global.images.pullSecret }}
122+
- name: {{ .Values.global.images.pullSecret }}
123+
{{- end }}
102124
{{- if .Values.images.productionServer.pullSecret }}
103125
- name: {{ .Values.images.productionServer.pullSecret }}
104126
{{- end }}
105-
{{- if .Values.images.matlabRuntime.pullSecret }}
127+
{{- if and .Values.images.matlabRuntime.pullSecret (ne .Values.images.matlabRuntime.pullSecret .Values.images.productionServer.pullSecret) }}
106128
- name: {{ .Values.images.matlabRuntime.pullSecret }}
107129
{{- end }}
108130

@@ -113,7 +135,19 @@ spec:
113135
configMap:
114136
name: matlab-production-server-config
115137
- name: auto-deploy
116-
{{- if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "hostpath" }}
138+
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
139+
# Valid options when archives API is enabled: createPVC: true / volumeType: pvc / empty
140+
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
141+
persistentVolumeClaim:
142+
claimName: dynamic-auto-deploy
143+
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "pvc" }}
144+
persistentVolumeClaim:
145+
claimName: {{ .Values.matlabProductionServerSettings.autoDeploy.claimName }}
146+
{{ else }}
147+
emptyDir: {}
148+
{{- end }}
149+
# Valid options for predef static volume: hostpath / nfs / pvc / azurefileshare / empty
150+
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "hostpath" }}
117151
hostPath:
118152
path: {{ .Values.matlabProductionServerSettings.autoDeploy.hostpath }}
119153
type: Directory
@@ -122,6 +156,9 @@ spec:
122156
server: {{ .Values.matlabProductionServerSettings.autoDeploy.server }}
123157
path: {{ .Values.matlabProductionServerSettings.autoDeploy.path }}
124158
readOnly: true
159+
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "pvc" }}
160+
persistentVolumeClaim:
161+
claimName: {{ .Values.matlabProductionServerSettings.autoDeploy.claimName }}
125162
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "azurefileshare" }}
126163
azureFile:
127164
shareName: {{ .Values.matlabProductionServerSettings.autoDeploy.shareName }}
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 }}

0 commit comments

Comments
 (0)