Main Content

mosadm bootstrap-node

Install Kubernetes and configure single-node Kubernetes cluster for MATLAB Online Server

Since R2020a

    Description

    example

    mosadm bootstrap-node installs Kubernetes®, initializes a single-node Kubernetes cluster on the machine where it is being installed, and customizes the cluster for MATLAB® Online Server™.

    The exact commands executed by this command depend on the operating system:

    mosadm bootstrap-node option1 ... optionN initializes the node using the specified configuration options.

    Note

    mosadm bootstrap-node requires sudo administration privileges.

    Examples

    collapse all

    sudo ./mosadm bootstrap-node

    Input Arguments

    collapse all

    One or more configuration options, specified as strings corresponding to valid configuration options from this table.

    Specific to mosadm bootstrap-node

    OptionDescription

    --preserve-docker-config

    Preserve the existing Docker® configuration on the machine where you are installing MATLAB Online Server. If you do not specify this option, then mosadm bootstrap-node creates or updates the configuration file for the Docker daemon (/etc/docker/daemon.json) and sets these properties, overwriting any existing ones.

    {
          "exec-opts": ["native.cgroupdriver=systemd"],
          "log-driver": "json-file",
          "log-opts": {
            "max-size": "100m"
          },
          "storage-driver": "overlay2"
    }
    

    For more details on Docker daemon configuration files, see the Docker Daemon documentation (Docker).

    Common to All mosadm Commands

    OptionDescription

    --charts-dir chartsDir

    Name of the MATLAB Online Server charts folder to use. This folder contains the Helm® charts of the server.

    Specify chartsDir as an absolute path or a path relative to the MATLAB Online Server root folder mosRoot.

    Example: matlab_online_server/charts.

    Default: mosRoot/charts

    --data-dir dataDir

    Name of the MATLAB Online Server data folder to use.

    Specify dataDir as an absolute path or a path relative to the MATLAB Online Server root folder mosRoot.

    Example: matlab_online_server/data.

    Default: mosRoot/data

    --dry-run

    Print out the commands that would have run without this option specified but do not run the operation. Specify this option to test that the operation produces the expected results before actually executing it.

    --help, -h, help

    Output help for mosadm bootstrap-node to the command line.

    --kube-config configFilePath

    Path to the Kubernetes cluster configuration file. Specify configFilePath as an absolute path or a path relative to the MATLAB Online Server root folder mosRoot.

    Example: /etc/kubernetes/admin.conf

    By default, configFilePath is empty and Kubernetes obtains the cluster configuration from the KUBECONFIG environment variable (if specified) or the ~/.kube/config file. If you run mosadm bootstrap-node with sudo, then ~/.kube/config is equivalent to /root/.kube/config.

    --mos-root rootDir

    MATLAB Online Server root folder, specified as an absolute path or a path relative to the current folder, that is, the folder in which you can run mosadm commands.

    Default: . (current folder)

    --overrides-dir overridesDir

    Name of the MATLAB Online Server overrides folder to use.

    Specify overridesDir as an absolute path or a path relative to the MATLAB Online Server root folder, mosRoot.

    Example: matlab_online_server/overrides

    Default: mosRoot/overrides

    --quiet, -q

    Print only the most useful or relevant output from the mosadm bootstrap-node command.

    --skip-log-file

    Skip creating the install.log file and logging data about the mosadm bootstrap-node operation to this file.

    --skip-prompt, -y

    Force acceptance of the terms of use for the mosadm bootstrap-node and skip any command-line prompts normally provided when calling this command.

    --tmp-dir tempDirName

    Name of MATLAB Online Server temporary folder to use.

    Specify tempDirName as an absolute path or a path relative to the temporary folder.

    By default, mosadm bootstrap-node generates a new temporary folder every time you run the command.

    --verbose

    Output extra details about the mosadm bootstrap-node operation to the command line.

    More About

    collapse all

    Bootstrap Node for Ubuntu Systems

    When bootstrap-node is executed on an Ubuntu distribution, the following changes are applied to the machine.

    After the operating system is configured with the following settings, the Kubernetes single-node cluster is bootstrapped.

    • Coredns is installed (to allow DNS lookups within the Kubernetes pods).

    • Kube-proxy is removed.

    • Kube-router is installed as the container network interface and proxy server, and the network policy provider.

    • The current node is untainted to allow Kubernetes to schedule pods.

    Extra Repositories

    The following repositories are added to the package manager apart from the pre-built defaults:

    • https://pkgs.k8s.io/core:/stable:/v1.27/deb/Release.key (key)

    • https://pkgs.k8s.io/core:/stable:/v1.27/deb/

    Updates

    apt-get update is called within the script to update all the base utilities of the operating system.

    Container Registries

    mosadm bootstrap-node pulls the base container image flavors used to install and configure MATLAB Online Server from these registries:

    • registry.k8s.io

    • docker.io

    Installed Utilities

    The following operating system utilities are installed as part of the bootstrap process:

    • unzip

    • gettext

    • jq

    • ca-certificates

    • curl

    • software-properties-common

    • git

    • nfs-common

    • ipvsadm

    • kubelet (1.27)

    • kubeadm (1.27)

    • kubectl (1.27)

    • helm (3.7.0)

    Networking

    The script allows and configures the following:

    • Bridge networking

    • IP forwarding

    • Enables the following IPVS modules:

      • Ip_vs_dh

      • ip_vs_ftp

      • ip_vs

      • ip_vs_lblc

      • ip_vs_lblcr

      • ip_vs_lc

      • ip_vs_nq

      • ip_vs_rr

      • ip_vs_sed

      • ip_vs_sh

      • ip_vs_wlc

      • ip_vs_wrr

    • Enables firewall

      • By default, only ssh (22), http (80), and https (443) are allowed.

      • All other ports are disabled if ufw is already installed (on Ubuntu distribution, ufw is installed by default).

    Miscellaneous
    • Enables high precision timestamps in syslog.

    • Disables swap (disabling swap is required by the Kubernetes or kubelet to bootstrap).

    Bootstrap Node for Red Hat or CentOS Systems

    Note

    For Red Hat or CentOS, set the SELINUX profile to permissive mode. The following commands can be executed with sudo privileges.

    # Set SELinux in permissive mode (effectively disabling it)

    1. setenforce 0

    2. sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

    When bootstrap-node is executed on Red Hat or CentOS distributions, the following changes are applied to the machine.

    After the operating system is configured with the following settings, Kubernetes single-node cluster is bootstrapped.

    • Coredns is installed, to allow DNS lookups within the Kubernetes pods.

    • Kube-proxy is removed.

    • Kube-router is installed as the container network interface and proxy server, and the network policy provider.

    • The current node is untainted to allow Kubernetes to schedule pods.

    Extra Repositories

    The following repositories are added to the package manager apart from the pre-built defaults:

    • https://pkgs.k8s.io/core:/stable:/v1.27/rpm/repodata/repomd.xml.key (key)

    • https://pkgs.k8s.io/core:/stable:/v1.27/rpm/

    Updates

    yum update is called within the script to update all the base utilities of the operating system.

    Container Registries

    mosadm bootstrap-node pulls the base container image flavors used to install and configure MATLAB Online Server from these registries:

    • registry.k8s.io

    • docker.io

    Installed Utilities

    The following operating system utilities are installed as part of the bootstrap process:

    • unzip

    • gettext

    • jq

    • ca-certificates

    • curl

    • software-properties-common

    • git

    • nfs-common

    • ipvsadm

    • kubelet (1.27)

    • kubeadm (1.27)

    • kubectl (1.27)

    • helm (3.7.0)

    Networking

    The script allows and configures the following:

    • Bridge networking

    • IP forwarding

    • Enables the following IPVS modules:

      • Ip_vs_dh

      • ip_vs_ftp

      • ip_vs

      • ip_vs_lblc

      • ip_vs_lblcr

      • ip_vs_lc

      • ip_vs_nq

      • ip_vs_rr

      • ip_vs_sed

      • ip_vs_sh

      • ip_vs_wlc

      • ip_vs_wrr

      • br_netfilter

    • Enables firewall

      • By default, only ssh (22), http (80), and https (443) are allowed.

      • All other ports are disabled if firewalld is already installed (on Red Hat distribution, firewalld is installed by default).

    Miscellaneous

    • The script enables high precision timestamps in syslog.

    • Disables swap (disabling swap is required by the Kubernetes or kubelet to bootstrap).

    Version History

    Introduced in R2020a