diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index e53635d..46b551b 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -7,8 +7,8 @@ on: - Helm_artifacts env: - HELM_CHART_VERSION: 1.1.0 - MATLAB_APP_VERSION: "R2024b" + HELM_CHART_VERSION: 1.2.0 + MATLAB_APP_VERSION: "R2025a" jobs: release-helm-chart: diff --git a/LICENSE.md b/LICENSE.md index 440f91a..1db2bb8 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -4,7 +4,7 @@ The files in this GitHub repository refer to commercial software products and se The following license terms apply only to the files in this GitHub repository, including files in this folder and its subfolders, and do not apply to MathWorks Programs. References to “software” and “code” in the following license terms refer to the files in this GitHub repository. -Copyright (c) 2024, The MathWorks, Inc. +Copyright (c) 2025, The MathWorks, Inc. All rights reserved. diff --git a/README.md b/README.md index bef5930..00de5ce 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,10 @@ 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 by using the following `helm install` command: + Next, install the Helm chart for MATLAB Production Server R2025a by using the following `helm install` command: ``` - helm install -f [-n ] --generate-name oci://containers.mathworks.com/matlab-prodserver-k8s --version 1.1.0 + helm install -f [-n ] --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. @@ -71,7 +71,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 `` with the release version, for example, `R2024b`. +2. Navigate to the Helm chart folder for the release you want to use. Replace `` with the release version, for example, `R2025a`. ``` cd matlab-production-server-on-kubernetes/releases//matlab-prodserver ``` @@ -88,7 +88,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. - * `` is the tag name of the MATLAB Production Server release, for example, `r2024b`. + * `` is the tag name of the MATLAB Production Server release, for example, `r2025a`. The `values.yaml` file specifies these values in the `productionServer` section, in the `registry`, `repository`, and `tag` variables, respectively. @@ -99,7 +99,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. - * `` 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, `r2024b`. MATLAB Production Server supports MATLAB Runtime versions up to six releases back from the MATLAB Production Server version you are using. + * `` 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. The `values.yaml` file specifies these values in the `matlabRuntime` section, in the `registry`, `repository`, and `tag` variables, respectively. @@ -187,5 +187,5 @@ If you require assistance, contact [MathWorks Technical Support](https://www.mat ## License -MATHWORKS CLOUD REFERENCE ARCHITECTURE LICENSE © 2024 The MathWorks, Inc. +MATHWORKS CLOUD REFERENCE ARCHITECTURE LICENSE © 2025 The MathWorks, Inc. diff --git a/releases/R2022a/matlab-prodserver/templates/mps-1-service-ingress.yaml b/releases/R2022a/matlab-prodserver/templates/mps-1-service-ingress.yaml deleted file mode 100644 index 033a215..0000000 --- a/releases/R2022a/matlab-prodserver/templates/mps-1-service-ingress.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# -# Expose MATLAB Production Server internal endpoint -# -kind: Service -apiVersion: v1 -metadata: - name: matlab-production-server - namespace: {{ .Release.Namespace }} - labels: - app: mps - release: {{ .Release.Name }} -spec: - selector: - app: mps - ports: - - name: mps-port - port: 9910 - targetPort: 9910 - type: ClusterIP - ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: matlab-production-server-ingress - namespace: {{ .Release.Namespace }} - labels: - release: {{ .Release.Name }} - annotations: - {{ if .Values.global.ingressController }} - ## set ingress-conroller vendor-specific annotations: - {{- range $key, $value := .Values.global.ingressController.annotations }} - {{ $key }}: {{ quote $value }} - {{- end }} - {{ end }} -spec: - ingressClassName: {{ .Values.global.ingressController.name }} - rules: - - host: {{ .Values.global.ingressController.domainBase }} - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: matlab-production-server - port: - number: 9910 - diff --git a/releases/R2022a/matlab-prodserver/Chart.yaml b/releases/R2025a/matlab-prodserver/Chart.yaml similarity index 74% rename from releases/R2022a/matlab-prodserver/Chart.yaml rename to releases/R2025a/matlab-prodserver/Chart.yaml index f3c0759..e95d5d4 100644 --- a/releases/R2022a/matlab-prodserver/Chart.yaml +++ b/releases/R2025a/matlab-prodserver/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: "R2022a" +appVersion: "R2025a" description: MATLAB Production Server Helm chart for Kubernetes name: matlab-prodserver-k8s -version: 0.1.1 +version: 1.2.0 diff --git a/releases/R2025a/matlab-prodserver/templates/mps-1-service-ingress.yaml b/releases/R2025a/matlab-prodserver/templates/mps-1-service-ingress.yaml new file mode 100644 index 0000000..0c2c9a5 --- /dev/null +++ b/releases/R2025a/matlab-prodserver/templates/mps-1-service-ingress.yaml @@ -0,0 +1,83 @@ +# +# Expose MATLAB Production Server internal endpoint +# +kind: Service +apiVersion: v1 +metadata: + name: matlab-production-server + namespace: {{ .Release.Namespace }} + labels: + app: mps + release: {{ .Release.Name }} +spec: + selector: + app: mps + ports: + - name: mps-port + port: 9910 + targetPort: 9910 + type: ClusterIP + +--- +{{- if .Values.global.ingressController.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: matlab-production-server-ingress + namespace: {{ .Release.Namespace }} + labels: + release: {{ .Release.Name }} + annotations: + {{ if .Values.global.ingressController }} + ## set ingress-conroller vendor-specific annotations: + {{- range $key, $value := .Values.global.ingressController.annotations }} + {{ $key }}: {{ quote $value }} + {{- end }} + {{ 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: + paths: + - path: / + pathType: Prefix + backend: + service: + name: matlab-production-server + port: + number: 9910 +{{- end }} + +--- +{{ if and (.Values.optionalSettings.Prometheus.enabled) (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: matlab-production-server-monitor + labels: + app: mps + app.kubernetes.io/part-of: {{ .Values.optionalSettings.Prometheus.matchOn }} + release: {{ .Values.optionalSettings.Prometheus.matchOn }} +spec: + selector: + matchLabels: + app: mps + release: {{ .Release.Name }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + endpoints: + - port: mps-port + path: /api/metrics +{{ end }} + diff --git a/releases/R2022a/matlab-prodserver/templates/mps-2-configmap.yaml b/releases/R2025a/matlab-prodserver/templates/mps-2-configmap.yaml similarity index 84% rename from releases/R2022a/matlab-prodserver/templates/mps-2-configmap.yaml rename to releases/R2025a/matlab-prodserver/templates/mps-2-configmap.yaml index 9f3e110..3b3dfec 100644 --- a/releases/R2022a/matlab-prodserver/templates/mps-2-configmap.yaml +++ b/releases/R2025a/matlab-prodserver/templates/mps-2-configmap.yaml @@ -9,7 +9,7 @@ data: main_config: | --http 9910 --ssl-verify-peer-mode no-verify-peer - --ssl-protocols TLSv1.1,TLSv1.2 + --ssl-protocols TLSv1.2 --ssl-ciphers ALL --mcr-root /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }} --num-workers {{ .Values.matlabProductionServerSettings.numWorkers | default 1 }} @@ -42,6 +42,7 @@ data: --server-memory-threshold-overflow-action purge_responses --enable-discovery --enable-metrics + --routes-file ./config/routes.json {{- if .Values.optionalSettings.Redis.host }} mps_cache_config: | @@ -49,8 +50,18 @@ data: {"{{ .Values.optionalSettings.Redis.name }}": {"Provider":"Redis", "Host":{{ .Values.optionalSettings.Redis.host | quote }}, - "Port":{{ .Values.optionalSettings.Redis.port | default 6379 }}} + "Port":{{ .Values.optionalSettings.Redis.port | default 6379 }} + {{- if .Values.optionalSettings.Redis.auth }} + ,"Key":{{ .Values.optionalSettings.Redis.auth | quote }} + {{- end }} + } } } {{- end }} + routes.json: | + { + "version": "1.0.0", + "pathmap": [] + } + diff --git a/releases/R2022a/matlab-prodserver/templates/mps-3-deployment.yaml b/releases/R2025a/matlab-prodserver/templates/mps-3-deployment.yaml similarity index 70% rename from releases/R2022a/matlab-prodserver/templates/mps-3-deployment.yaml rename to releases/R2025a/matlab-prodserver/templates/mps-3-deployment.yaml index a319f63..1743fc8 100644 --- a/releases/R2022a/matlab-prodserver/templates/mps-3-deployment.yaml +++ b/releases/R2025a/matlab-prodserver/templates/mps-3-deployment.yaml @@ -19,25 +19,34 @@ spec: labels: app: mps annotations: + {{ if not .Values.optionalSettings.Prometheus.enabled }} prometheus.io/scrape: 'true' prometheus.io/path: '/api/metrics' prometheus.io/port: '9910' + {{ end }} spec: securityContext: runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 + runAsUser: 1001 + runAsGroup: 1001 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 @@ -62,8 +71,8 @@ spec: exec: command: - ls - - /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/MCR_license.txt - initialDelaySeconds: 30 + - /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/matlabruntime_license_agreement.pdf + initialDelaySeconds: 10 periodSeconds: 30 livenessProbe: @@ -82,7 +91,7 @@ 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 @@ -97,10 +106,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 }} @@ -120,6 +132,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 }} diff --git a/releases/R2022a/matlab-prodserver/values.yaml b/releases/R2025a/matlab-prodserver/values.yaml similarity index 57% rename from releases/R2022a/matlab-prodserver/values.yaml rename to releases/R2025a/matlab-prodserver/values.yaml index bb4daca..7b0a546 100644 --- a/releases/R2022a/matlab-prodserver/values.yaml +++ b/releases/R2025a/matlab-prodserver/values.yaml @@ -5,19 +5,28 @@ global: agreeToLicense: "" # Network License Manager: server host and port number, example: 27000@hostname licenseServer: 27000@hostname + # Override for a private container registry, example: cr.example.com, cr-secret + images: + registry: "" + pullSecret: "" ingressController: + enabled: false # Create 'Ingress' API object # Nginx settings (optional) name: nginx - annotations: - nginx.ingress.kubernetes.io/affinity: "cookie" - nginx.ingress.kubernetes.io/load-balance: "round_robin" - nginx.ingress.kubernetes.io/proxy-read-timeout: "300" + annotations: {} + + # Ingress host domainBase: matlabprodserver.mwcloudtest.com + # Ingress https (tls termination) + tls: + enabled: false + # Name of kubernetes.io/tls secret with certificate data + secretName: "" matlabProductionServerSettings: # CTF files are placed here for automatic deployment. autoDeploy: - # Inline mount options: hostpath, nfs, azurefileshare, empty (default) + # Inline mount options: hostpath, nfs, pvc, azurefileshare, empty (default) volumeType: "empty" # Node mount dir, example: /mnt/share/autodeploy hostpath: "" @@ -27,6 +36,9 @@ matlabProductionServerSettings: # NFS subpath, example: /vmgr/sandbox/share/autodeploy path: "" # ================================================================= + # Persistent-Volume-Claim name, example: autodeploy-pv-claim + claimName: "" + # ================================================================= # Azure storage account file share name, example: auto-deploy-share shareName: "" # Azure storage account key secret name, example: azure-file-secret @@ -39,16 +51,16 @@ images: productionServer: registry: containers.mathworks.com repository: matlab-production-server - tag: r2022a - variant: R2022a + tag: r2025a + variant: R2025a pullPolicy: IfNotPresent pullSecret: "" matlabRuntime: registry: containers.mathworks.com repository: matlab-runtime - tag: r2022a - variant: v912 + tag: r2025a + variant: R2025a pullPolicy: IfNotPresent pullSecret: "" @@ -60,6 +72,18 @@ deploymentSettings: optionalSettings: Redis: - host: {} + # Redis service fully qualified name, example: redis.namespace.svc.cluster.local + host: "" + auth: "" name: myRedis + port: 6379 + secretName: "" + secretKey: "" + Prometheus: + # Create a ServiceMonitor [monitoring.coreos.com/v1] for metrics discovery. + # Requires Prometheus and Prometheus Operator (CRDs) to be pre-installed. + enabled: false + # Helm release name or app.kubernetes.io/part-of label of Prometheus stack. + # ServiceMonitor needs to match on this value (if Prometheus is enabled). + matchOn: prometheus