Working with Docker Containers#
In order to work with Docker containers on nodes, workloads need to be provisioned in the Management System. Here, provisioning is the creation of a workload and its storage in the workload repository of the Management System so that it can be deployed to nodes. This requires configuration of the workload and files that need to be uploaded to the Management System. After that, the workload can be deployed to nodes.
The following instructions cover the basic requirements for provisioning a Docker workload. Optional settings will be left out. Extended options are addressed in the last section of this chapter.
There are two further types of workloads that can be provisioned: CODESYS workloads and Virtual Machine workloads. The process for each workload is highlighted in its respective chapter.
Note
A Docker image is required for the following instructions. Consult the Docker documentation for help on creating a Docker image.
- Log in to the Management System.
- Select Workloads in the left-hand menu.
- Select + in the upper-right corner.
-
Select the Docker symbol (Docker workload) on the right of the three symbols that expanded.
-
In the new window, enter a name for your workload.
-
Select + next to Versions to add a new version of the workload.
-
In the next window, enter the following information:
Item Description Name Enter a Name for the version of this workload. Release name Enter a Release name for the version of this workload. DOCKER IMAGE Select From registry or Upload.
If you select From registry, you need to enter the Docker registry to the Docker container image under Image path.
If you select Upload, click the upward arrow symbol to upload the Docker container image.System memory to reserve Assign how much system memory you would like to reserve for this workload. From registry:
Upload:
-
Select Save in the lower-left corner.
The workload has now been provisioned and is ready to be deployed in the Deploy menu.
Note
While some settings are not required to provision a Docker workload in the Management System, you will have to fill out additional settings for the workload to perform as desired. Depending on the Docker container you want to deploy, you will need to define ports and configure environment variables. Please keep this in mind and make sure to learn the details about your Docker container.
Settings for Docker Workloads#
In the instructions above, all optional settings have been left out. Below is an overview of all the options with an explanation to each option.
Setting | Description |
---|---|
VERSION SPECIFIC INFO | Name A name for your workload version. This could be a reminder for a certain configuration. Example: "Unlimited" as a name for a Node-RED version that has unlimited access to CPU resources. Release name A release name for your workload version. This could be a version number. Example: 1.0.1 |
DOCKER CONTAINER FILE MANAGEMENT | You can select between two options here and either use a Docker registry URL to link to an online repository or upload the Docker container image from your workstation. From registry If you select this, you have to specify a URL pointing to the Docker container image under Image path below. Please note the differences between public Docker Hub registries and private registries. Private registries require the full URL to be specified, as well as a username and password if they require authentication. Public Docker Hub registries can be specified in their short form. Examples:
If you select this, you have to upload the Docker container image from your workstation. Do so by clicking the upward arrow symbol to open your file browser. |
DOCKER CONTAINER SPECIFIC INFO | Add port Click here to define a Host port and a Container port. Please make sure to select the appropriate container port as it depends on the Docker container you are deploying. Add environment variable Click here to add an environment variable (Env. variable) and its Variable value. Please make sure to define the appropriate variables and values as they depend on the Docker container you are deploying, Docker volumes for persistent storage If your workload needs persistent storage, specify the path of the Docker volumes in the Docker container here. The volume for persistent storage is not erased even if the Docker workload is undeployed. System memory to reserve Assign how much system memory you would like to reserve for this workload. The memory assigned here is an upper limit that the Docker workload can use and is not exclusively reserved for the Docker workload. Other processes can use these resources as well. Limit the amount of CPU resources Specify here how many CPU cores the workload is allowed to use. If this field is left blank, the workload is allowed to use all available resources. Container restart policy Choose the container restart policy here to determine when the Docker container can be restarted.
|
SELECTOR | Labels If you have defined labels and assigned them to nodes, you can add them as selectors to the workload. When deploying a workload, the list of nodes will be filtered automatically to the specified label. |
Mark as released | Tick this checkbox if you want to mark this workload as released. Once marked as released, the workload cannot be edited anymore. |