Skip to content

Commit c505135

Browse files
committed
Version 1.5.0
1 parent 2ca973b commit c505135

21 files changed

+385
-63
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ kubectl get secrets mjs-metrics-client-certs --template="{{.data.prometheus.key
503503

504504
MATLAB Job Scheduler in Kubernetes uses a Kubernetes load balancer service to expose MATLAB Job Scheduler to MATLAB clients running outside of the Kubernetes cluster.
505505
By default, the Helm chart creates the load balancer for you.
506+
You can customize the annotations on the Kubernetes load balancer service by setting the `loadBalancerAnnotations` parameter in your `values.yaml` file.
506507
You can also create and customize your own load balancer service before you install the Helm chart.
507508

508509
Create a Kubernetes load balancer service `mjs-ingress-proxy` to expose MATLAB Job Scheduler to MATLAB clients running outside of the Kubernetes cluster.

chart/mjs/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ apiVersion: v2
33
name: mjs
44
description: A Helm chart for MATLAB (R) Job Scheduler in Kubernetes
55
type: application
6-
version: 1.4.0
7-
appVersion: 1.4.0
6+
version: 1.5.0
7+
appVersion: 1.5.0

chart/mjs/templates/_paths.tpl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@
66
/opt/matlab
77
{{- end -}}
88

9-
# Checkpoint base on containers
10-
# If running as non-root user and not mounting checkpointbase, use a directory that a non-root user can create
9+
# Checkpoint base on containers; all MJS data except the job database is stored here.
10+
# Note that this data is not persisted across pod restarts, as we want a fresh MJS every time.
1111
{{- define "paths.checkpointbase" -}}
12+
/tmp/checkpoint
13+
{{- end -}}
14+
15+
# Database directory on the job manager pod.
16+
# If running as non-root user and not mounting a checkpoint PVC, use a directory that a non-root user can create
17+
{{- define "paths.databasedir" -}}
1218
{{- $isNonRoot := ne (int $.Values.jobManagerUserID) 0 -}}
1319
{{- if and $isNonRoot (empty $.Values.checkpointPVC) -}}
14-
/tmp/checkpoint
20+
/tmp/database
1521
{{- else -}}
16-
/mjs/checkpoint
22+
/mjs/database
1723
{{- end -}}
1824
{{- end -}}
1925

chart/mjs/templates/controller-configmap.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Config file for the MJS controller.
2-
# Copyright 2024 The MathWorks, Inc.
2+
# Copyright 2024-2025 The MathWorks, Inc.
33
{{- $workerImageTag := .Values.matlabImageTag | default .Values.matlabRelease }}
44
{{- $jobManagerImageTag := .Values.jobManagerImageTag | default .Values.matlabRelease }}
55
{{- $workerImage := .Values.matlabImage }}
@@ -25,9 +25,10 @@ data:
2525
{{- $comma = "," }}
2626
{{- end }}
2727
],
28+
"AdditionalWorkerPVCs": {{ toJson (.Values.additionalWorkerPVCs | default dict) }},
2829
"BasePort": {{ .Values.basePort | int }},
2930
"CertFileName": {{ include "paths.certFile" . | quote }},
30-
"CheckpointBase": {{ include "paths.checkpointbase" . | quote }},
31+
"CheckpointBase": {{ include "paths.databasedir" . | quote }},
3132
"CheckpointPVC": {{ .Values.checkpointPVC | quote }},
3233
"ClusterHost": {{ .Values.clusterHost | quote }},
3334
"ControllerLogfile": {{ include "paths.controllerLog" . | quote }},
@@ -46,6 +47,7 @@ data:
4647
"JobManagerMemoryRequest": {{ .Values.jobManagerMemoryRequest | quote }},
4748
"JobManagerGroupID": {{ .Values.jobManagerGroupID }},
4849
"JobManagerNodeSelector": {{ toJson .Values.jobManagerNodeSelector }},
50+
"JobManagerTolerations": {{ toJson .Values.jobManagerTolerations | quote }},
4951
"JobManagerUserID": {{ .Values.jobManagerUserID }},
5052
"JobManagerUsesPVC": {{ .Values.jobManagerUsesPVC }},
5153
"JobManagerUID": {{ uuidv4 | quote }},
@@ -97,6 +99,7 @@ data:
9799
"WorkerMemoryRequest": {{ .Values.workerMemoryRequest | quote }},
98100
"WorkerLogPVC": {{ .Values.workerLogPVC | quote }},
99101
"WorkerNodeSelector": {{ toJson .Values.workerNodeSelector }},
102+
"WorkerTolerations": {{ toJson .Values.workerTolerations | quote }},
100103
"WorkerPassword": {{ .Values.workerPassword | quote }},
101104
"WorkersPerPoolProxy": {{ .Values.workersPerPoolProxy }},
102105
"WorkerUsername": {{ .Values.workerUsername | quote }},

chart/mjs/templates/controller-deployment.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,30 @@ spec:
2424

2525
# Schedule on same nodes as the job manager
2626
nodeSelector: {{ toJson .Values.jobManagerNodeSelector }}
27+
tolerations: {{ toJson .Values.jobManagerTolerations }}
2728

2829
containers:
2930
- name: {{ $name }}
3031
image: {{ printf "%s:%s" .Values.controllerImage $controllerImageTag }}
3132
imagePullPolicy: {{ .Values.controllerImagePullPolicy }}
3233

34+
# Set optional resource requests and limits
35+
resources:
36+
requests:
37+
{{- if .Values.controllerCPURequest }}
38+
cpu: {{ .Values.controllerCPURequest }}
39+
{{- end }}
40+
{{- if .Values.controllerMemoryRequest }}
41+
memory: {{ .Values.controllerMemoryRequest }}
42+
{{- end }}
43+
limits:
44+
{{- if .Values.controllerCPULimit }}
45+
cpu: {{ .Values.controllerCPULimit }}
46+
{{- end }}
47+
{{- if .Values.controllerMemoryLimit }}
48+
memory: {{ .Values.controllerMemoryLimit }}
49+
{{- end }}
50+
3351
# The controller process requires the path to a config file as an input argument
3452
# This file is mounted from a ConfigMap (defined in mjs.yaml)
3553
{{- $configMapDir := "/config" }}
@@ -57,4 +75,4 @@ spec:
5775
- name: {{ $logVolName }}
5876
persistentVolumeClaim:
5977
claimName: {{ .Values.logPVC }}
60-
{{- end }}
78+
{{- end }}

chart/mjs/templates/ingress-proxy-deployment.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,30 @@ spec:
2222

2323
# Schedule on same nodes as the job manager
2424
nodeSelector: {{ toJson .Values.jobManagerNodeSelector }}
25+
tolerations: {{ toJson .Values.jobManagerTolerations }}
2526

2627
containers:
2728
- name: haproxy
2829
image: {{ $.Values.haproxyImage }}
2930
imagePullPolicy: {{ $.Values.haproxyImagePullPolicy }}
3031

32+
# Set optional resource requests and limits
33+
resources:
34+
requests:
35+
{{- if .Values.haproxyCPURequest }}
36+
cpu: {{ .Values.haproxyCPURequest }}
37+
{{- end }}
38+
{{- if .Values.haproxyMemoryRequest }}
39+
memory: {{ .Values.haproxyMemoryRequest }}
40+
{{- end }}
41+
limits:
42+
{{- if .Values.haproxyCPULimit }}
43+
cpu: {{ .Values.haproxyCPULimit }}
44+
{{- end }}
45+
{{- if .Values.haproxyMemoryLimit }}
46+
memory: {{ .Values.haproxyMemoryLimit }}
47+
{{- end }}
48+
3149
# Pass the config file path as an input argument
3250
{{- $configDir := "/usr/local/etc/haproxy/" }}
3351
args:

chart/mjs/templates/ingress-proxy-service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ metadata:
88
name: {{ $name }}
99
labels:
1010
app: {{ $name }}
11+
annotations: {{ toJson .Values.loadBalancerAnnotations }}
1112
spec:
1213
type: LoadBalancer
1314
selector:

chart/mjs/templates/mjs-configmap.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ data:
5151
# Add LDAP certificate to the Java trust store
5252
chmod +w {{ $trustStorePath }}
5353
yes | {{ include "paths.matlabroot" . }}/sys/java/jre/glnxa64/jre/bin/keytool -import -keystore {{ $trustStorePath }} -file {{ include "paths.ldapCert" . }} -storepass changeit > /dev/null
54-
54+
5555
{{ end -}}
5656
# Start the MJS service
5757
{{ printf "%s/mjs" $binDir }} start -mjsdef {{ $localMJSDef }} -loglevel {{ .Values.logLevel }} -disablereliableconnections
5858
5959
# Start the job manager
60-
{{- $jmCommand := printf "%s/startjobmanager -name \"%s\" -baseport %d" $binDir .Values.jobManagerName $basePort }}
60+
{{- $jmCommand := printf "%s/startjobmanager -name \"%s\" -baseport %d -databaseDirectory %s" $binDir .Values.jobManagerName $basePort (include "paths.databasedir" .) }}
6161
{{- if .Values.requireClientCertificate }}
6262
{{- $jmCommand = printf "%s -certificate \"%s\"" $jmCommand (include "paths.certPath" .) }}
6363
{{- end }}
6464
{{- if .Values.requireScriptVerification }}
6565
{{- $jmCommand = printf "%s -secretfile \"%s\"" $jmCommand (include "paths.secretPath" .) }}
6666
{{- end }}
67-
{{ $jmCommand }} || echo "startjobmanager failed; there may already be a job manager running"
67+
{{ $jmCommand }}
6868
6969
# Keep the container running
7070
sleep infinity

chart/mjs/values.schema.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
"type": "string"
88
}
99
},
10+
"additionalWorkerPVCs": {
11+
"type": "object",
12+
"additionalProperties": {
13+
"type": "string"
14+
}
15+
},
1016
"adminUser": {
1117
"type": "string"
1218
},
@@ -28,6 +34,18 @@
2834
"clusterHost": {
2935
"type": "string"
3036
},
37+
"controllerCPULimit": {
38+
"anyOf": [
39+
{ "type": "string" },
40+
{ "type": "number" }
41+
]
42+
},
43+
"controllerCPURequest": {
44+
"anyOf": [
45+
{ "type": "string" },
46+
{ "type": "number" }
47+
]
48+
},
3149
"controllerImage": {
3250
"type": "string"
3351
},
@@ -38,6 +56,18 @@
3856
"controllerImageTag": {
3957
"type": "string"
4058
},
59+
"controllerMemoryLimit": {
60+
"anyOf": [
61+
{ "type": "string" },
62+
{ "type": "number" }
63+
]
64+
},
65+
"controllerMemoryRequest": {
66+
"anyOf": [
67+
{ "type": "string" },
68+
{ "type": "number" }
69+
]
70+
},
4171
"enableServiceLinks": {
4272
"type": "boolean"
4373
},
@@ -50,13 +80,40 @@
5080
"type": "string"
5181
}
5282
},
83+
"global": {
84+
"type": "object"
85+
},
86+
"haproxyCPULimit": {
87+
"anyOf": [
88+
{ "type": "string" },
89+
{ "type": "number" }
90+
]
91+
},
92+
"haproxyCPURequest": {
93+
"anyOf": [
94+
{ "type": "string" },
95+
{ "type": "number" }
96+
]
97+
},
5398
"haproxyImage": {
5499
"type": "string"
55100
},
56101
"haproxyImagePullPolicy": {
57102
"type": "string",
58103
"enum": ["Always", "Never", "IfNotPresent"]
59104
},
105+
"haproxyMemoryLimit": {
106+
"anyOf": [
107+
{ "type": "string" },
108+
{ "type": "number" }
109+
]
110+
},
111+
"haproxyMemoryRequest": {
112+
"anyOf": [
113+
{ "type": "string" },
114+
{ "type": "number" }
115+
]
116+
},
60117
"idleStop": {
61118
"type": "integer",
62119
"minimum": 0
@@ -111,6 +168,15 @@
111168
"type": "string"
112169
}
113170
},
171+
"jobManagerTolerations": {
172+
"type": "array",
173+
"items": {
174+
"type": "object",
175+
"additionalProperties": {
176+
"type": "string"
177+
}
178+
}
179+
},
114180
"jobManagerUserID": {
115181
"type": "integer",
116182
"minimum": 0
@@ -140,6 +206,12 @@
140206
"type": "integer",
141207
"minimum": 1
142208
},
209+
"loadBalancerAnnotations": {
210+
"type": "object",
211+
"additionalProperties": {
212+
"type": "string"
213+
}
214+
},
143215
"logLevel": {
144216
"type": "integer",
145217
"minimum": 0,
@@ -308,6 +380,15 @@
308380
"type": "integer",
309381
"minimum": 1
310382
},
383+
"workerTolerations": {
384+
"type": "array",
385+
"items": {
386+
"type": "object",
387+
"additionalProperties": {
388+
"type": "string"
389+
}
390+
}
391+
},
311392
"workerUsername": {
312393
"type": "string"
313394
}

chart/mjs/values.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Default values for MATLAB Job Scheduler (MJS) in Kubernetes.
2-
# Copyright 2024 The MathWorks, Inc.
2+
# Copyright 2024-2025 The MathWorks, Inc.
33

44
# Release number of the MATLAB version to use
55
matlabRelease: "r2024a"
@@ -60,10 +60,20 @@ poolProxyCPULimit: "" # CPU limit for each parallel pool proxy process
6060
poolProxyCPURequest: "0.5" # CPU request for each parallel pool proxy process
6161
poolProxyMemoryLimit: "" # Memory limit for each parallel pool proxy process
6262
poolProxyMemoryRequest: "500Mi" # Memory request for each parallel pool proxy process
63+
controllerCPULimit: "" # CPU limit for the MJS controller
64+
controllerCPURequest: "100m" # CPU request for the MJS controller
65+
controllerMemoryLimit: "" # Memory limit for the MJS controller
66+
controllerMemoryRequest: "128Mi" # Memory request for the MJS controller
67+
haproxyCPULimit: "" # CPU limit for the HAProxy pod
68+
haproxyCPURequest: "100m" # CPU request for the HAProxy pod
69+
haproxyMemoryLimit: "" # Memory limit for the HAProxy pod
70+
haproxyMemoryRequest: "256Mi" # Memory request for the HAProxy pod
6371

6472
# Node settings
6573
jobManagerNodeSelector: {} # Node selector for the job manager, specified as key-value pairs
6674
workerNodeSelector: {} # Node selector for the workers, specified as key-value pairs
75+
jobManagerTolerations: [] # Tolerations for the job manager pod
76+
workerTolerations: [] # Tolerations for the worker pods
6777

6878
# Auto-scaling settings
6979
idleStop: 300 # Time after which idle worker pods will be removed
@@ -72,6 +82,7 @@ stopWorkerGracePeriod: 60 # Grace period in seconds for running stopworker
7282

7383
# Network settings
7484
autoCreateLoadBalancer: true # Flag to automatically create a Kubernetes load balancer to expose MATLAB Job Scheduler to MATLAB clients outside the cluster
85+
loadBalancerAnnotations: {} # Annotations to use for the load balancer
7586

7687
# Parallel pool proxy settings
7788
poolProxyBasePort: 30000 # Base port for parallel pool proxies
@@ -94,6 +105,9 @@ matlabPVC: "" # Name of a PVC that contains a MATLAB Parallel Server installatio
94105
jobManagerUsesPVC: false # If true, the job manager container mounts the MATLAB Parallel Server installation from the PVC rather than using the jobManagerImage parameter
95106
additionalMatlabPVCs: [] # Names of PersistentVolumeClaims containing installations of older MATLAB Parallel Server releases, specified as an array
96107

108+
# Worker pod settings
109+
additionalWorkerPVCs: {} # Additional PersistentVolumeClaims to mount on worker pods, specifed as a map of claim names to mount paths
110+
97111
# Specify the maximum number of workers that the cluster can automatically resize to in your custom values.yaml file.
98112
# maxWorkers: 32
99113

0 commit comments

Comments
 (0)