3.2. Podman Installation

You may want to choose a native Podman installation if you want a very fast and easy installation. You just have to provide a Podman host system to install and run the images we provide.

3.2.1. Prerequisites

Please make sure that you provide the following prerequisites:

  1. a valid licence file is needed (get it at speedgain.com)

  2. any platform that has Podman installed

  3. 4 Cores, 16GB RAM and at least 100GB to store data

  4. free ports 80 or 443 are needed to access the web services (5432 for postgresql/timescale is optional)

  5. a modern web-browser

  6. the podman packages (podman, dnsmasq, containernetwork-plugins, podman-plugins)

3.2.2. Services

One service can’t be run on its own. It has to be executed with 5 other services (all available on Docker-Hub and via ITGAIN download portal: itgain.sharefile.eu ). The list of all 6 images:

  1. Timescale - as the repository to store all performance metrics

  2. Speedgain Collector - the core component to pull metrics

  3. Speedgain Service - rest api service

  4. Speedgain Frontend - web-frontend

  5. Speedgain Grafana - delivering all needed dashboards

  6. NginX - as reverse proxy

3.2.3. Install Step-by-Step

To install and run Speedgain for Databases via Podman, follow these steps:

  1. Install needed podman packages

    bash
    yum install -y dnsmasq
    yum install -y containernetworking-plugins
    yum install -y podman-plugins
  2. Get at least a trial license via speedgain.com

  3. Create a new folder with the name you want your Speedgain service to run as (e.g. "speedgain")

  4. Create a subfolder named "licence" in it

  5. Copy the licence file into the licence folder

  6. Create a subfolder named "configuration" in it

  7. Copy nginx.conf into that subfolder (NginX Configuration file)

  8. If you have internet access and by that to Docker-Hub, you can pull the images from hub.docker.com:

    bash
    podman pull docker.io/timescale/timescaledb:2.11.2-pg13
    podman pull docker.io/nginx:1.23
    podman pull docker.io/itgainis/s4dbs_collector:1.6.0
    podman pull docker.io/itgainis/s4dbs_grafana:1.6.0
    podman pull docker.io/itgainis/s4dbs_service:1.6.0
    podman pull docker.io/itgainis/s4dbs_frontend:1.6.0
  9. Optional: If you do not have direct access to Docker-Hub, download images from our download portal ( https://itgain.sharefile.eu/ ) and transfer to desired system and load via

    bash
    podman load --input s4dbs_v1.6.0_all_images.tar.gz
  10. Create a network for all Speedgain for Databases Pods

    bash
    podman network create s4dbs_network
  11. Create a network secret to store the PostgreSQL password

    bash
    printf "MySuperSecretPassword" | podman secret create s4dbs_pdbpass -
  12. Create the needed Pods (adjust the folder pointing to your licence and nginx.conf)

    bash
    # timescale/postgres
    podman run -d --network s4dbs_network --secret=s4dbs_pdbpass,type=env,target=POSTGRES_PASSWORD --name s4dbs_postgres -v s4dbs_postgres:/var/lib/postgresql/data docker.io/timescale/timescaledb:2.11.2-pg13
    
    # collector
    podman run -d --network s4dbs_network --secret=s4dbs_pdbpass,type=env,target=PDB_PASS --name s4dbs_collector -v /<PathToMyLicence>/Speedgain_for_Databases.licence:/SPEEDGAIN/licence/Speedgain_for_Databases.licence -e PDB_USER=postgres -e PDB_HOST=s4dbs_postgres -e PDB_PORT=5432 -e PDB_DB_NAME=speedgain -e SPGLOGLEVEL=INFO docker.io/itgainis/s4dbs_collector:1.6.0
    
    #service
    podman run -d --network s4dbs_network --secret=s4dbs_pdbpass,type=env,target=PDB_PASS --name s4dbs_service -e PDB_USER=postgres -e PDB_HOST=s4dbs_postgres -e PDB_PORT=5432 -e PDB_DB_NAME=speedgain -e SPGLOGLEVEL=INFO docker.io/itgainis/s4dbs_service:1.6.0
    
    #grafana
    podman run -d --network s4dbs_network --secret=s4dbs_pdbpass,type=env,target=PDB_PASS --name s4dbs_grafana -e PDB_USER=postgres -e PDB_HOST=s4dbs_postgres -e PDB_PORT=5432 -e PDB_DB_NAME=speedgain -e GF_SERVER_SERVE_FROM_SUB_PATH=true -e "GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/grafana/" docker.io/itgainis/s4dbs_grafana:1.6.0
    
    #frontend
    podman run -d --network s4dbs_network --name s4dbs_frontend -e FRONTEND_CONFIG_MODE=false docker.io/itgainis/s4dbs_frontend:1.6.0
    
    #reverse
    podman run -d --network s4dbs_network --name s4dbs_reverse -p 80:80 -v /<PathToMyNginx.conf>/nginx.conf:/etc/nginx/nginx.conf docker.io/nginx:1.23
  13. Create systemd unit files and enable systemd services

    bash
    # enable systemd units for podman
    sudo systemctl enable podman.socket
    sudo systemctl start podman.socket
    systemctl enable podman-restart
    
    # disbale stopping containers on logoff
    loginctl enable-linger
    
    # enable every pod as a systemctl unit
    mkdir systemd
    cd systemd
    podman generate systemd --restart-policy=always --files --name s4dbs_postgres
    podman generate systemd --restart-policy=always --files --name s4dbs_collector
    podman generate systemd --restart-policy=always --files --name s4dbs_service
    podman generate systemd --restart-policy=always --files --name s4dbs_grafana
    podman generate systemd --restart-policy=always --files --name s4dbs_frontend
    podman generate systemd --restart-policy=always --files --name s4dbs_reverse
    cp * /etc/systemd/system
    systemctl enable container-s4dbs_collector.service container-s4dbs_frontend.service container-s4dbs_grafana.service container-s4dbs_postgres.service container-s4dbs_reverse.service container-s4dbs_service.service
    podman stop s4dbs_postgres s4dbs_collector s4dbs_service s4dbs_grafana s4dbs_frontend s4dbs_reverse
    systemctl start container-s4dbs_collector.service container-s4dbs_frontend.service container-s4dbs_grafana.service container-s4dbs_postgres.service container-s4dbs_reverse.service container-s4dbs_service.service
  14. Open a web browser and navigate to http://<PodmanHostname>:80/s4dbs-ui/ or https://<PodmanHostname>:443/s4dbs-ui/ if you enabled SSL (Setup SSL encryption)

  15. Login with admin/admin (default user and pw) and configure the databases you like to monitor

3.2.4. Persistent Storage

Speedgain for Databases has a persistent volume for PostgreSQL/Timescale:

  • s4dbs_postgres - the volume for the Timescale container to store performance and configuration data

3.2.5. Customization Options

  • All containers will restart automatically if they fail or after a system restart (if the container service itself will restart)

  • Ports can be adjusted but maybe some config has to be changed as well - ask support for more detail and assistance

  • Port forwarding for PostgreSQL is optional and not needed for the services to run correctly

  • Timescaledb-tune accepts environment variables to specify your own limits (e.g. if you do not want to use all exisiting cpu and memory) (https://github.com/timescale/timescaledb-docker)

    1. TS_TUNE_MEMORY

    2. TS_TUNE_NUM_CPUS

  • Custom Dashboard Provisioning can be done via mounting a volume or a hostpath or files to "/s4dbs_custom_boards" in the grafana container

  • Grafana dashboards are now stored on a volume mounted to the path /grafanaprovisioning in the grafana container, so individual dashboard changes can be persisted

  • Frontend environment variable FRONTEND_CONFIG_MODE controls the behavior of Speedgains web frontend, to automatically generate the URL of the Speedgain Service (s4dbs_service) and the Speedgain Grafana server (s4dbs_grafana). This is helpful in Kubernetes and OpenShift environments, were you don’t know the final DNS name of your container cluster. FRONTEND_CONFIG_MODE can have the following values:

    • ( unset / not specified ) - equals the value of "false"

    • true - The manually configured URLs of the Speedgain Service and Grafana server will be used. This is recommended if you are not in a Kubernetes or OpenShift environment.

    • false - Automatically generates URLs for Speedgain Service and Grafana server. Manually configured ports and hostnames for Service and Grafana server will be ignored. The NginX reverse proxy is mandatory for this configuration!

3.2.6. Setup SSL encryption

The bundled NginX configuration file already includes a disabled configuration template for setting up SSL quickly. Before you start the reverse proxy (s4dbs_reverse), follow the instructions below to activate SSL.

  1. To enable SSL you first need both a .crt and a .key file with your organisations SSL certificate data.

  2. In the folder of your Speedgain for Databases services (e.g. "speedgain"), create a new folder named "ssl"

    bash
    mkdir ssl
  3. Copy your .crt and .key files into this new folder

    bash
    cp company_ssl.key ~/speedgain/ssl/ssl_cert.key
    cp company_ssl.crt ~/speedgain/ssl/ssl_cert.crt

    You can of course choose a different target filename but remember to change the Docker compose and the NginX config file accordingly.

  4. Open the nginx.conf file in the configuration subfolder and look for the following lines and enable these 4 lines

    ...
      server {
    ...
    #SSL Config
    # Enable the following 4 lines if SSL should be activated:
    #    listen 443 ssl http2;
    #    listen [::]:443 ssl http2;
    #    ssl_certificate_key /etc/ssl/ssl_cert.key;
    #    ssl_certificate     /etc/ssl/ssl_cert.crt;
  5. Start the reverse Pod with different Port Mapping and include the crt and key file.

    bash
    podman run -d --network s4dbs_network --name s4dbs_reverse -p 443:443 -v /<PathToMyNginx.conf>/nginx.conf:/etc/nginx/nginx.conf -v /ssl/ssl_cert.key:/etc/ssl/ssl_cert.key -v ./ssl/ssl_cert.crt:/etc/ssl/ssl_cert.crt  docker.io/nginx:1.23
  6. Follow the steps within step-by-step to set up systemd unit files (Install Step-by-Step)

Remember, if you use a different name than ssl_cert.key and ssl_cert.crt, you have to change your configuration accordingly!