IBM / ibm-spectrum-scale-bridge-for-grafana

This tool allows the IBM Storage Scale users to perform performance monitoring for IBM Storage Scale devices using third-party applications such as Grafana or Prometheus software.
Apache License 2.0
31 stars 18 forks source link

SERVER default not working in container #139

Closed uli42 closed 11 months ago

uli42 commented 11 months ago

The documentation states that the bridge should run on a collector node. So I tried to run the container there and all I got was WARNING - Perfmon RESTcall error __ Server responded: 503 Connection refused from server

After searching for quite some time I finally found the reason: The container needs to know the server's IP from inside the container. It does not work with the default of 0.0.0.0, and it does (of course) not work with any of the server's IP, because inside the container the host is reachable by another IP. So finally I got it working with this internal address automatically provided by podman:

podman run -dt -p 4242:4242 -e SERVER=host.containers.internal -e APIKEYVALUE=... --name grafana_bridge localhost/bridge_image:latest

host.containers.internal is the magic here. So I propose to change the default in the Dockerfile to that address and also add a comment to the config file about this.

Helene commented 11 months ago

I think, you misunderstood the documentation. The statement "the bridge should run on a collector node" is valid for a traditional bare metal setup.

An application running in a container is encapsulated, i.e. running on separate (virtual) host. Therefore you need as first change pmcollector setting and allow communication with external hosts. Read here

The step 4. in the example shows that the SERVER parameter need to be passed through by starting bridge container.

The Dockefile SERVER default value "0.0.0.0" allows you to build image accepting any SERVER IP. In that way you can use the same image for running multiple bridge containers communicating with different servers (pmcollector's). For example, if you have multiple IBM Storage Scale devices.