Main Content

Set MATLAB Installation Source

Specify the source of the MATLAB® Pool pod installation in the mountType field of the matlab-pool.yaml file. MATLAB Online Server™ uses this information to mount the MATLAB installation so that it can interact with it.

This table shows the available configuration options.

MATLAB Installation SourcemountType ValueDescription

Container image

"embedded" (default)
  • Enables easy export of MATLAB installation across Kubernetes® clusters.

  • Requires large image installation.

See Mount MATLAB from Built Container Image.

One or more Kubernetes nodes

"host"
  • Enables use of existing MATLAB installation, without a large image installation.

  • Export across Kubernetes clusters is more difficult.

See Mount MATLAB from Kubernetes Nodes.

NFS server

"nfs"
  • Enables use of existing MATLAB installation, without a large image installation.

  • Performance might be slower because installation is on a network drive.

See Mount MATLAB from NFS Server.

Persistent volume claim (PVC)

"pvc"
  • Can be used with cloud-provided Kubernetes clusters.

  • Performance might be slower because installation is on a network drive.

See Mount MATLAB from Persistent Volume Claim.

Mount MATLAB from Built Container Image

With this mounting configuration, you build a MATLAB container image and make the image available inside MATLAB Online Server. This is the default option.

Use this configuration to make it easy to export the MATLAB installation across Kubernetes clusters, such as when:

  • Exporting to different cloud-provided Kubernetes clusters

  • Working across different Kubernetes clusters within the same version of MATLAB

For details on building a MATLAB image in the container, see mosadm build-matlab-image.

To use this configuration, set these matlab-pool.yaml fields:

matlab:
  installation:
    mountType: "embedded"

To specify the container image that MATLAB Online Server uses, set these fields:

images:
  matlabEmbedded:
    image: "com.mathworks.matlabonlineserver.matlab-image"
    tag: "R2024b"
    registry:
    repository:
  • Update image and tag with the information for your image.

  • To use the global image settings, leave registry and repository empty.

Mount MATLAB from Kubernetes Nodes

If MATLAB is installed on the same machine as your single-node or multinode Kubernetes cluster, you can make the MATLAB installation available to MATLAB Online Server directly.

For cloud-provided Kubernetes installations, unless the nodes are customized to support this configuration, this mounting type is not recommended.

To use this configuration, set these matlab-pool.yaml fields:

matlab:
  installation:
    mountType: "host"
    path: "/MATLAB"
  • Update path with the path to the MATLAB installation folder. For multinode Kubernetes installations, the path value must be the same across all nodes.

Mount MATLAB from NFS Server

Use this configuration when the MATLAB installation is on an NFS server that the Kubernetes cluster can access. This option makes the MATLAB installation directly available to MATLAB Online Server without having to build a large image.

Performance might be slower with this option when compared to the direct installation options, because MATLAB Online Server loads MATLAB from a network location.

To use this configuration, set these matlab-pool.yaml fields:

matlab:
  installation:
    mountType: "nfs"
    server: "nfs-server"
    path: "/exports/MATLAB/R2024b"
  • Update server with the IP address of the NFS server of a fully-qualified server name.

  • Update path with the subpath on the NFS server that contains the MATLAB installation.

Mount MATLAB from Persistent Volume Claim

If the previous configurations are not available, you can make the MATLAB installation available through a Kubernetes Persistent Volume Claim (PVC). You can back the PVC with a different storage provider by using a Container Storage Interface (CSI). For more details on PVC mounting, see Persistent Volume Claim (PVC).

Consider using this option for cloud-provided Kubernetes installations. Performance might be slower with this option when compared to the direct installation options, because MATLAB Online Server loads MATLAB from a network location.

To use this configuration, set these matlab-pool.yaml fields:

matlab:
  installation:
    mountType: "pvc"
    claimName: "matlab-r2024b-pvc"
    path: ""
  • Update claimName with the name of the PVC where the MATLAB installation is available. For multinode Kubernetes clusters, the PVC must be available to all nodes.

  • Update path with the path within the PVC where the MATLAB installation is available.

Update Server

To apply your changes, undeploy and redeploy the MATLAB pool service.

./mosadm undeploy matlab-pool
./mosadm deploy matlab-pool

Related Topics