Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- Helm_artifacts

env:
HELM_CHART_VERSION: 1.2.0
MATLAB_APP_VERSION: "R2025a"
HELM_CHART_VERSION: 1.3.0
MATLAB_APP_VERSION: "R2025b"

jobs:
release-helm-chart:
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Before starting, you need the following:
* [Git™](https://git-scm.com/)
* [Docker®](https://www.docker.com/)
* Running [Kubernetes](https://kubernetes.io/) cluster that meets the following conditions:
* Uses Kubernetes version 1.29 or later.
* Uses Kubernetes version 1.32 or later.
* Each MATLAB Production Server container in the Kubernetes cluster requires at least 1 CPU core and 2 GiB RAM.
* [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) command-line tool that can access your Kubernetes cluster
* [Helm](https://helm.sh/) package manager to install Helm charts that contain preconfigured Kubernetes resources for MATLAB Production Server
* Uses Helm version v3.14 or later.
* Uses Helm version v3.17 or later.

If you do not have a license, please contact your MathWorks representative [here](https://www.mathworks.com/company/aboutus/contact_us/contact_sales.html) or [request a trial license](https://www.mathworks.com/campaigns/products/trials.html?prodcode=PR).

Expand All @@ -53,11 +53,11 @@ The Quick Start option only requires you to download a single file, rather than
To accept the license terms, set global > agreeToLicense to "yes".
To specify the address of the license server, set global > licenseServer using the format port_number@host.

Next, install the Helm chart for MATLAB Production Server R2025a by using the following `helm install` command:
Next, install the Helm chart for MATLAB Production Server R2025b by using the following `helm install` command:
```
helm install -f <path/to/values-overrides.yaml> [-n <k8s-namespace>] --generate-name oci://containers.mathworks.com/matlab-prodserver-k8s --version 1.3.0
```

```
helm install -f <path/to/values-overrides.yaml> [-n <k8s-namespace>] --generate-name oci://containers.mathworks.com/matlab-prodserver-k8s --version 1.2.0
```
4. After the deployment is complete, upload the MATLAB Production Server deployable archive to your network file server or Azure file share. All users must have read permission to the deployable archive.

## Deployment Steps
Expand All @@ -70,7 +70,7 @@ The MATLAB Production Server on Kubernetes GitHub repository contains Helm chart
```
This repository includes Helm chart folders for each supported MATLAB Production Server release and a `values-overrides.yaml` file containing configuration options that apply across all release deployments.

2. Navigate to the Helm chart folder for the release you want to use. Replace `<release>` with the release version, for example, `R2025a`.
2. Navigate to the Helm chart folder for the release you want to use. Replace `<release>` with the release version, for example, `R2025b`.
```
cd matlab-production-server-on-kubernetes/releases/<release>/matlab-prodserver
```
Expand All @@ -87,7 +87,7 @@ The MATLAB Production Server on Kubernetes GitHub repository contains Helm chart
```
* `containers.mathworks.com` is the name of the container registry.
* `matlab-production-server` is the name of the repository.
* `<release-tag>` is the tag name of the MATLAB Production Server release, for example, `r2025a`.
* `<release-tag>` is the tag name of the MATLAB Production Server release, for example, `r2025b`.

The `values.yaml` file specifies these values in the `productionServer` section, in the `registry`, `repository`, and `tag` variables, respectively.

Expand All @@ -98,7 +98,7 @@ The MATLAB Production Server on Kubernetes GitHub repository contains Helm chart
```
* `containers.mathworks.com` is the name of the container registry.
* `matlab-runtime` is the name of the repository.
* `<release-tag>` is the tag name of the MATLAB Runtime release. Update this value to the release version of the MATLAB Runtime you are using, for example, `r2025a`. MATLAB Production Server supports MATLAB Runtime versions up to six releases back from the MATLAB Production Server version you are using.
* `<release-tag>` is the tag name of the MATLAB Runtime release. Update this value to the release version of the MATLAB Runtime you are using, for example, `r2025b`. MATLAB Production Server supports MATLAB Runtime versions up to six releases back from the MATLAB Production Server version you are using.

The `values.yaml` file specifies these values in the `matlabRuntime` section, in the `registry`, `repository`, and `tag` variables, respectively.

Expand Down
75 changes: 0 additions & 75 deletions releases/R2022b/matlab-prodserver/values.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: "R2022b"
appVersion: "R2025b"
description: MATLAB Production Server Helm chart for Kubernetes
name: matlab-prodserver-k8s
version: 0.1.2
version: 1.3.0
18 changes: 18 additions & 0 deletions releases/R2025b/matlab-prodserver/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Chart validation checks:

{{- define "checkConditionReplicaCount" -}}
{{- if and (gt (int .Values.deploymentSettings.replicaCount) 1) .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
{{- if ne .Values.matlabProductionServerSettings.autoDeploy.archivesApi.accessMode "ReadWriteMany" }}
{{- fail "Configuring multiple replicas requires PVC with ReadWriteMany Access-Mode." }}
{{- end }}
{{- end }}
{{- end }}

{{- define "checkConditionVolumeType" -}}
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
{{- $volumeType := .Values.matlabProductionServerSettings.autoDeploy.volumeType }}
{{- if and (ne $volumeType "pvc") (ne $volumeType "empty") }}
{{- fail "Configuring archives API is only supported with pvc or empty volume types." }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
type: ClusterIP

---
{{- if .Values.global.ingressController.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand All @@ -35,6 +36,15 @@ metadata:
{{ end }}
spec:
ingressClassName: {{ .Values.global.ingressController.name }}
{{ if .Values.global.ingressController.tls.enabled }}
tls:
- hosts:
- {{ .Values.global.ingressController.domainBase }}
{{- if .Values.global.ingressController.tls.secretName }}
secretName: {{ .Values.global.ingressController.tls.secretName }}
{{- end }}
{{ end }}

rules:
- host: {{ .Values.global.ingressController.domainBase }}
http:
Expand All @@ -46,6 +56,7 @@ spec:
name: matlab-production-server
port:
number: 9910
{{- end }}

---
{{ if and (.Values.optionalSettings.Prometheus.enabled) (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ data:
main_config: |
--http 9910
--ssl-verify-peer-mode no-verify-peer
--ssl-protocols TLSv1.1,TLSv1.2
--ssl-ciphers ALL
--ssl-protocols TLSv1.2,TLSv1.3
--ssl-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305
--mcr-root /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}
--num-workers {{ .Values.matlabProductionServerSettings.numWorkers | default 1 }}
--worker-restart-interval 12:00:00
Expand All @@ -24,7 +24,7 @@ data:
--log-rotation-size 100MB
--log-archive-root ./old_logs
--log-archive-max-size 1GB
--log-root ./log
{{ ternary "--log-root ./log" "" .Values.matlabProductionServerSettings.localFileLogging }}
--log-stdout
--license {{ .Values.global.licenseServer | default "27000@hostname" }}
--license-grace-period 2:30
Expand All @@ -42,7 +42,17 @@ data:
--server-memory-threshold-overflow-action purge_responses
--enable-discovery
--enable-metrics
{{ ternary "--enable-archive-management" "" .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
--routes-file ./config/routes.json
{{- if .Values.matlabProductionServerSettings.accessControl.enabled }}
--access-control-provider OAuth2
--access-control-config ./config/jwt_idp.json
--access-control-policy ./config/ac_policy.json

jwt_idp.json: {{ .Values.matlabProductionServerSettings.accessControl.identityProvider | quote }}

ac_policy.json: {{ .Values.matlabProductionServerSettings.accessControl.policyRules | quote }}
{{- end }}

{{- if .Values.optionalSettings.Redis.host }}
mps_cache_config: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#
# MATLAB Production Server instance
#
{{- include "checkConditionVolumeType" . }}
{{- include "checkConditionReplicaCount" . }}

apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -19,6 +22,7 @@ spec:
labels:
app: mps
annotations:
checksum/config: {{ include (print $.Template.BasePath "/mps-2-configmap.yaml") . | sha256sum }}
{{ if not .Values.optionalSettings.Prometheus.enabled }}
prometheus.io/scrape: 'true'
prometheus.io/path: '/api/metrics'
Expand All @@ -27,19 +31,29 @@ spec:
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
runAsUser: 1001
runAsGroup: 1001
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
fsGroup: 1001
{{- end }}

containers:
- name: mps
image: {{ .Values.images.productionServer.registry }}/{{ .Values.images.productionServer.repository }}:{{ .Values.images.productionServer.tag }}
image: {{ .Values.global.images.registry | default .Values.images.productionServer.registry }}/{{ .Values.images.productionServer.repository }}:{{ .Values.images.productionServer.tag }}
env:
- name: AGREE_TO_MATHWORKS_SOFTWARE_LICENSE
value: {{ .Values.global.agreeToLicense | default "no" | lower | quote }}
value: {{ required "agreeToLicense must be set to \"yes\"." .Values.global.agreeToLicense | default "no" | lower | quote }}
- name: AGREE_TO_MATLAB_RUNTIME_LICENSE
value: {{ .Values.global.agreeToLicense | default "no" | lower | quote }}
value: {{ required "agreeToLicense must be set to \"yes\"." .Values.global.agreeToLicense | default "no" | lower | quote }}
- name: LD_LIBRARY_PATH
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"
{{ if .Values.optionalSettings.Redis.secretName }}
- name: MPS_REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.optionalSettings.Redis.secretName }}
key: {{ .Values.optionalSettings.Redis.secretKey | default "redis-password" }}
{{ end }}

ports:
- containerPort: 9910
Expand All @@ -49,14 +63,15 @@ spec:
cpu: {{ .Values.deploymentSettings.cpuRequest | default "1" | quote }}
memory: {{ .Values.deploymentSettings.memoryRequest | default "2Gi" | quote }}
limits:
cpu: {{ .Values.matlabProductionServerSettings.numWorkers | default "1" | quote }}
memory: "8Gi"
cpu: {{ .Values.deploymentSettings.cpuLimit | default "1" | quote }}
memory: {{ .Values.deploymentSettings.memoryLimit | default "8Gi" | quote }}

volumeMounts:
- name: auto-deploy
mountPath: "/opt/mpsinstance/auto_deploy"
- name: mcr-root
mountPath: "/opt/matlabruntime"
readOnly: true
- name: mps-config
mountPath: "/opt/mpsinstance/config"

Expand All @@ -65,7 +80,7 @@ spec:
command:
- ls
- /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/matlabruntime_license_agreement.pdf
initialDelaySeconds: 30
initialDelaySeconds: 10
periodSeconds: 30

livenessProbe:
Expand All @@ -84,13 +99,21 @@ spec:

initContainers:
- name: matlab-runtime
image: {{ .Values.images.matlabRuntime.registry }}/{{ .Values.images.matlabRuntime.repository }}:{{ .Values.images.matlabRuntime.tag }}
image: {{ .Values.global.images.registry | default .Values.images.matlabRuntime.registry }}/{{ .Values.images.matlabRuntime.repository }}:{{ .Values.images.matlabRuntime.tag }}

command:
- /bin/sh
- -c
- "cp -r /opt/matlabruntime/* /mnt/"

resources:
requests:
cpu: {{ .Values.deploymentSettings.cpuRequest | default "1" | quote }}
memory: {{ .Values.deploymentSettings.memoryRequest | default "2Gi" | quote }}
limits:
cpu: {{ .Values.deploymentSettings.cpuLimit | default "1" | quote }}
memory: {{ .Values.deploymentSettings.memoryLimit | default "8Gi" | quote }}

volumeMounts:
- name: mcr-root
mountPath: "/mnt"
Expand All @@ -99,10 +122,13 @@ spec:

restartPolicy: {{ .Values.deploymentSettings.restartPolicy }}
imagePullSecrets:
{{- if .Values.global.images.pullSecret }}
- name: {{ .Values.global.images.pullSecret }}
{{- end }}
{{- if .Values.images.productionServer.pullSecret }}
- name: {{ .Values.images.productionServer.pullSecret }}
{{- end }}
{{- if .Values.images.matlabRuntime.pullSecret }}
{{- if and .Values.images.matlabRuntime.pullSecret (ne .Values.images.matlabRuntime.pullSecret .Values.images.productionServer.pullSecret) }}
- name: {{ .Values.images.matlabRuntime.pullSecret }}
{{- end }}

Expand All @@ -113,7 +139,19 @@ spec:
configMap:
name: matlab-production-server-config
- name: auto-deploy
{{- if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "hostpath" }}
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
# 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.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 }}
type: Directory
Expand All @@ -122,6 +160,9 @@ spec:
server: {{ .Values.matlabProductionServerSettings.autoDeploy.server }}
path: {{ .Values.matlabProductionServerSettings.autoDeploy.path }}
readOnly: true
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "pvc" }}
persistentVolumeClaim:
claimName: {{ .Values.matlabProductionServerSettings.autoDeploy.claimName }}
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "azurefileshare" }}
azureFile:
shareName: {{ .Values.matlabProductionServerSettings.autoDeploy.shareName }}
Expand Down
Loading