1
1
#
2
2
# MATLAB Production Server instance
3
3
#
4
+ {{- include "checkConditionVolumeType" . }}
5
+ {{- include "checkConditionReplicaCount" . }}
6
+
4
7
apiVersion : apps/v1
5
8
kind : Deployment
6
9
metadata :
19
22
labels :
20
23
app : mps
21
24
annotations :
25
+ checksum/config : {{ include (print $.Template.BasePath "/mps-2-configmap.yaml") . | sha256sum }}
22
26
{{ if not .Values.optionalSettings.Prometheus.enabled }}
23
27
prometheus.io/scrape : ' true'
24
28
prometheus.io/path : ' /api/metrics'
@@ -27,19 +31,29 @@ spec:
27
31
spec :
28
32
securityContext :
29
33
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 }}
32
39
33
40
containers :
34
41
- 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 }}
36
43
env :
37
44
- 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 }}
39
46
- 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 }}
41
48
- name : LD_LIBRARY_PATH
42
49
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 }}
43
57
44
58
ports :
45
59
- containerPort : 9910
65
79
command :
66
80
- ls
67
81
- /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/matlabruntime_license_agreement.pdf
68
- initialDelaySeconds : 30
82
+ initialDelaySeconds : 10
69
83
periodSeconds : 30
70
84
71
85
livenessProbe :
@@ -84,13 +98,18 @@ spec:
84
98
85
99
initContainers :
86
100
- 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 }}
88
102
89
103
command :
90
104
- /bin/sh
91
105
- -c
92
106
- " cp -r /opt/matlabruntime/* /mnt/"
93
107
108
+ resources :
109
+ limits :
110
+ cpu : " 1"
111
+ memory : " 4Gi"
112
+
94
113
volumeMounts :
95
114
- name : mcr-root
96
115
mountPath : " /mnt"
@@ -99,10 +118,13 @@ spec:
99
118
100
119
restartPolicy : {{ .Values.deploymentSettings.restartPolicy }}
101
120
imagePullSecrets :
121
+ {{- if .Values.global.images.pullSecret }}
122
+ - name : {{ .Values.global.images.pullSecret }}
123
+ {{- end }}
102
124
{{- if .Values.images.productionServer.pullSecret }}
103
125
- name : {{ .Values.images.productionServer.pullSecret }}
104
126
{{- end }}
105
- {{- if .Values.images.matlabRuntime.pullSecret }}
127
+ {{- if and .Values.images.matlabRuntime.pullSecret (ne .Values.images.matlabRuntime.pullSecret .Values.images.productionServer.pullSecret) }}
106
128
- name : {{ .Values.images.matlabRuntime.pullSecret }}
107
129
{{- end }}
108
130
@@ -113,7 +135,19 @@ spec:
113
135
configMap :
114
136
name : matlab-production-server-config
115
137
- 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" }}
117
151
hostPath :
118
152
path : {{ .Values.matlabProductionServerSettings.autoDeploy.hostpath }}
119
153
type : Directory
@@ -122,6 +156,9 @@ spec:
122
156
server : {{ .Values.matlabProductionServerSettings.autoDeploy.server }}
123
157
path : {{ .Values.matlabProductionServerSettings.autoDeploy.path }}
124
158
readOnly : true
159
+ {{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "pvc" }}
160
+ persistentVolumeClaim :
161
+ claimName : {{ .Values.matlabProductionServerSettings.autoDeploy.claimName }}
125
162
{{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "azurefileshare" }}
126
163
azureFile :
127
164
shareName : {{ .Values.matlabProductionServerSettings.autoDeploy.shareName }}
0 commit comments