Skip to content

Commit d8754f8

Browse files
authored
Global override for private registry (#21)
Co-authored-by: Eitan Steiner <[email protected]>
1 parent 4578eb3 commit d8754f8

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ After you pull the MATLAB Production Server and MATLAB Runtime container images
8282
8383
2. Push the images to your private registry by using [docker push](https://docs.docker.com/engine/reference/commandline/push/).
8484
85-
3. In the `values.yaml` file, set the `productionServer` > `registry` and `matlabRuntime` > `registry` variables to the name of your private registry.
85+
3. In the `values-overrides.yaml` file, set the `global` > `images` > `registry` variable to the name of your private registry.
8686
8787
4. If your private registry requires authentication, create a Kubernetes Secret that your pod can use to pull the image from the private registry. For more information, see [Pull an Image from a Private Registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) in the Kubernetes documentation.
8888
89+
5. In the `values-overrides.yaml` file, set the `global` > `images` > `pullSecret` variable to the name of the Kubernetes Secret you created.
90+
8991
### Provide Mapping for Deployable Archives
9092
Deploying MATLAB Production Server requires a running Kubernetes cluster. From the Kubernetes cluster that you use for MATLAB Production Server, provide a mapping from the storage location where you want to store MATLAB Production Server deployable archives (CTF files) to a storage resource in your cluster. You can store the deployable archives on the network file system or on the cloud. After the MATLAB Production Server deployment is complete, the deployable archives that you store in the mapped location are automatically deployed to the server.
9193

releases/R2023a/matlab-prodserver/templates/mps-3-deployment.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232

3333
containers:
3434
- name: mps
35-
image: {{ .Values.images.productionServer.registry }}/{{ .Values.images.productionServer.repository }}:{{ .Values.images.productionServer.tag }}
35+
image: {{ .Values.global.images.registry | default .Values.images.productionServer.registry }}/{{ .Values.images.productionServer.repository }}:{{ .Values.images.productionServer.tag }}
3636
env:
3737
- name: AGREE_TO_MATHWORKS_SOFTWARE_LICENSE
3838
value: {{ required "agreeToLicense must be set to \"yes\"." .Values.global.agreeToLicense | default "no" | lower | quote }}
@@ -84,7 +84,7 @@ spec:
8484

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

8989
command:
9090
- /bin/sh
@@ -99,10 +99,13 @@ spec:
9999

100100
restartPolicy: {{ .Values.deploymentSettings.restartPolicy }}
101101
imagePullSecrets:
102+
{{- if .Values.global.images.pullSecret }}
103+
- name: {{ .Values.global.images.pullSecret }}
104+
{{- end }}
102105
{{- if .Values.images.productionServer.pullSecret }}
103106
- name: {{ .Values.images.productionServer.pullSecret }}
104107
{{- end }}
105-
{{- if .Values.images.matlabRuntime.pullSecret }}
108+
{{- if and .Values.images.matlabRuntime.pullSecret (ne .Values.images.matlabRuntime.pullSecret .Values.images.productionServer.pullSecret) }}
106109
- name: {{ .Values.images.matlabRuntime.pullSecret }}
107110
{{- end }}
108111

releases/R2023a/matlab-prodserver/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ global:
55
agreeToLicense: ""
66
# Network License Manager: server host and port number, example: 27000@hostname
77
licenseServer: 27000@hostname
8+
# Override for a private container registry, example: cr.example.com, cr-secret
9+
images:
10+
registry: ""
11+
pullSecret: ""
812
ingressController:
913
# Nginx settings (optional)
1014
name: nginx

values-overrides.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ global:
55
agreeToLicense: ""
66
# Network License Manager: server host and port number, example: 27000@hostname
77
licenseServer: 27000@hostname
8+
# Override for private container registry, example: my-registry.example.com
9+
images:
10+
registry: ""
11+
pullSecret: ""
812
# Ingress settings (optional)
913
ingressController:
1014
name: nginx

0 commit comments

Comments
 (0)