Skip to content

Portainer

Portainer is a lightweight container management tool, simplifies the monitoring of containerized environments, offering a user-friendly interface for visualizing device health and performance metrics.

Portainer consists of two elements: the Portainer Server and the Portainer Agent. Both run as lightweight containers on your existing containerized infrastructure. The Portainer Agent should be deployed to each node in your cluster and configured to report back to the Portainer Server container.

A single Portainer Server will accept connections from any number of Portainer Agents, providing the ability to manage multiple clusters from one centralized interface. To do this, the Portainer Server container requires data persistence. The Portainer Agents are stateless, with data being shipped back to the Portainer Server container.

In this section an integration example of the eManager with Portainer will be presented.

Example of use with the eManager

This example is only a proof of concept to show how eManager can be integrated with some monitoring tools.

In this example we are going to use Portainer to be able to deploy different docker containers into the eManager.

Once we finish the example we will obtain a configuration as the one shown below.

Portainer_5

In the next sections, the steps that must be followed to reproduce this example will be detailed.

1. Install eManager prerequisits

First, we must change eManager docker configuration to be able to listen through TCP to other devices that wanted to connect to the eManager from the outside.

Be aware that this change is only made as a proof of concept. We highly do not recommend to make this change to the eManager for a normal use since it can expose the eManager to external attacks.

  1. Open docker service file: nano /lib/systemd/system/docker.service
  2. Modify ExecStart line with this information: ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376 and save the file.
  3. Execute: systemctl daemon-reload
  4. Execute: systemctl restart docker

2. Install Portainer

Note

The process detailed below has been tested with Debian 10 and Ubuntu 20.04.

Once the eManager is prepared, Portainer need to be installed using docker in your laptop.

  1. Install docker in your laptop:
    sudo apt update
    sudo apt install docker-ce
    
  2. Create a new directory for this example: mkdir portainer_docker
  3. Create a docker-compose file to install both tools with the following content:
    cd portainer_docker
    nano docker-compose.yml
    
    services:
      portainer:
        restart: unless-stopped
        image: portainer/portainer-ce:2.19.4
        ports:
          - 8100:8000
          - 9443:9443
        volumes:
          - portainer-data:/data
          - /var/run/docker.sock:/var/run/docker.sock
    volumes:
      portainer-data:
    
  4. Execute: docker-compose up

You can access Portainer using https://localhost:9443 in your web browser. A window as the one shown below should be displayed.

Portainer_1

3. Configure the eManager in Portainer

The first step is to create new user credentials by choosing a new password. Once created, you should see a screen as in the image below.

Portainer_2

To start configuring the eManager, select Add Environments and then Docker Standalone. Finally click the Start wizard button. The image below should appear.

Portainer_3

Select the API option and fulfill the configuration by choosing a name for your device and setting the IP address of your device and the port we have enabled in the prerequisites section for the eManager. In this example, the device name will be eManager-Pro-demo, the IP used 10.1.10.10 and the port 2376.

Portainer_4

Finally, our environment has been created.

Once the environment of our eManager is set, it is possible to create different containers in it through Portainer.