Skip to content

Commit 5e8fcdf

Browse files
esteinerMWEitan Steiner
and
Eitan Steiner
authored
Add configuration for https using ingress tls-termination (#23)
* Add configuration for https using ingress tls-termination * Updated README * Updated README * Updated README --------- Co-authored-by: Eitan Steiner <[email protected]>
1 parent 2d999de commit 5e8fcdf

File tree

6 files changed

+36
-10
lines changed

6 files changed

+36
-10
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ Before starting, you need the following:
2525
* [Git™](https://git-scm.com/)
2626
* [Docker®](https://www.docker.com/)
2727
* Running [Kubernetes](https://kubernetes.io/) cluster that meets the following conditions:
28-
* Uses Kubernetes version 1.25 or later.
28+
* Uses Kubernetes version 1.26 or later.
2929
* Each MATLAB Production Server container in the Kubernetes cluster requires at least 1 CPU core and 2 GiB RAM.
3030
* [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) command-line tool that can access your Kubernetes cluster
3131
* [Helm](https://helm.sh/) package manager to install Helm charts that contain preconfigured Kubernetes resources for MATLAB Production Server
32-
* Uses Helm version v3.10.1 or later.
32+
* Uses Helm version v3.13.0 or later.
3333

3434
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).
3535

@@ -95,7 +95,7 @@ To specify mapping, in the top-level `values-overrides.yaml` file, under `matlab
9595
9696
To specify the storage location for storing deployable archives, under `autoDeploy`, set `volumeType` to one of the following:
9797
98-
* `"nfs"` &mdash; Store archives to a location on the network file system. Specify values for the `server` and `path` variables.
98+
* `"nfs"` &mdash; Store archives to a location on the network file system. Specify values for the `server` and `path` variables. Specify the hostname of your NFS server in the `server` variable and the location of your deployable archives in the `path` variable. For more information about the `nfs` option, see [Volumes](https://kubernetes.io/docs/concepts/storage/volumes/) in the Kubernetes documentation.
9999
* `"pvc"` &mdash; Store archives to a persistent volume by using a Persistent Volume Claim. Specify a value for the `claimName` variable. To use this option, you must have an existing Persistent Volume Claim that is already bound to its underlying storage volume.
100100
* `"azurefileshare"` &mdash; Store archives to a file share using Azure™ Files. Specify values for `shareName` and `secretName` variables. To use this option, you must have an existing file share and Kubernetes secret used to access the file share. For details about Azure file shares, see [Create and use a volume with Azure Files in Azure Kubernetes Service (AKS)](https://learn.microsoft.com/en-us/azure/aks/azure-csi-files-storage-provision) in the Azure documentation.
101101
@@ -112,7 +112,7 @@ Before installing the chart, first set parameters that state your agreement to t
112112
Then, install the Helm chart for MATLAB Production Server by using the `helm install` command:
113113
114114
```
115-
helm install -f <path/to/values-overrides.yaml> [-n <k8s-namespace>] --generate-name <path/to/chart>
115+
helm install -f <path/to/values-overrides.yaml> [-n <k8s-namespace>] --generate-name <path/to/chart directory>
116116
```
117117
118118
After you install the chart, the pod takes a few minutes to initialize because the installation consists of approximately 10 GB of container images.
@@ -125,6 +125,7 @@ After the deployment is complete, upload the MATLAB Production Server deployable
125125
126126
### Manage External Access Using Ingress
127127
You can manage access to MATLAB Production Server by specifying an [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) controller. The Ingress controller also acts as a load balancer and is the preferred way to expose MATLAB Production Server services in production. This reference architecture assumes that you have an existing Ingress controller already running on the Kubernetes cluster. Specify controller options in the `ingressController` variable of the `values-overrides.yaml` file or use the default values.
128+
You can enable inbound HTTPS connections by using an Ingress controller TLS termination.
128129
129130
### Test Client Access Using Port Forwarding
130131
To test that the deployment was successful, first, use *port forwarding* to map the port that is running MATLAB Production Server inside the cluster (default = 9910) to a port that is available outside the cluster.

releases/R2023b/matlab-prodserver/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v2
22
appVersion: "R2023b"
33
description: MATLAB Production Server Helm chart for Kubernetes
44
name: matlab-prodserver-k8s
5-
version: 1.0.0
5+
version: 1.0.1

releases/R2023b/matlab-prodserver/templates/mps-1-service-ingress.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ metadata:
3535
{{ end }}
3636
spec:
3737
ingressClassName: {{ .Values.global.ingressController.name }}
38+
{{ if .Values.global.ingressController.tls.enabled }}
39+
tls:
40+
- hosts:
41+
- {{ .Values.global.ingressController.domainBase }}
42+
{{- if .Values.global.ingressController.tls.secretName }}
43+
secretName: {{ .Values.global.ingressController.tls.secretName }}
44+
{{- end }}
45+
{{ end }}
46+
3847
rules:
3948
- host: {{ .Values.global.ingressController.domainBase }}
4049
http:

releases/R2023b/matlab-prodserver/templates/mps-2-configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ data:
99
main_config: |
1010
--http 9910
1111
--ssl-verify-peer-mode no-verify-peer
12-
--ssl-protocols TLSv1.1,TLSv1.2
12+
--ssl-protocols TLSv1.2
1313
--ssl-ciphers ALL
1414
--mcr-root /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}
1515
--num-workers {{ .Values.matlabProductionServerSettings.numWorkers | default 1 }}

releases/R2023b/matlab-prodserver/values.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ global:
1212
ingressController:
1313
# Nginx settings (optional)
1414
name: nginx
15-
annotations:
16-
nginx.ingress.kubernetes.io/affinity: "cookie"
17-
nginx.ingress.kubernetes.io/load-balance: "round_robin"
18-
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
15+
annotations: {}
16+
17+
# Ingress host
1918
domainBase: matlabprodserver.mwcloudtest.com
19+
# Ingress https (tls termination)
20+
tls:
21+
enabled: false
22+
# Name of kubernetes.io/tls secret with certificate data
23+
secretName: ""
2024

2125
matlabProductionServerSettings:
2226
# CTF files are placed here for automatic deployment.

values-overrides.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,22 @@ global:
99
images:
1010
registry: ""
1111
pullSecret: ""
12+
1213
# Ingress settings (optional)
1314
ingressController:
1415
name: nginx
16+
annotations:
17+
nginx.ingress.kubernetes.io/affinity: "cookie"
18+
nginx.ingress.kubernetes.io/load-balance: "round_robin"
19+
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
20+
21+
# Ingress host
1522
domainBase: matlabprodserver.mwcloudtest.com
23+
# Ingress https (tls termination)
24+
tls:
25+
enabled: false
26+
# Name of kubernetes.io/tls secret with certificate data
27+
secretName: ""
1628

1729
matlabProductionServerSettings:
1830
# CTF files are placed here for automatic deployment.

0 commit comments

Comments
 (0)