Closed vnourdin closed 1 year ago
Have a look at openfaas0 and the CNI bridge, this allows access to things running on the host.
You may need to bind to that IP address instead of 127.0.0.1 - or to all IP addresses i.e. 0.0.0.0
The other idea (preferred) is:
1) Run Prometheus on the host as well with a much higher retention period 2) Use Prometheus federation to allow the host to collect all of the metrics from within OpenFaaS - see the note under "Monitoring the Client clusters" - https://prometheus.io/docs/prometheus/latest/federation/
If you don't want to run Prometheus twice, you could use Grafana Cloud which has a generous free tier.
/add label: support,question
Could you add your production example to the adopters file? Thanks https://github.com/openfaas/faas/blob/master/ADOPTERS.md
I added myself as an adopter, as soon as the app is launched, I'll add a link to it. Thanks again for your help !
/lock: resolved
Why do you need this?
I want to put as much data possible in the prometheus already in place for faasd. I added a
node-exporter
to retrieve host data (using/proc
and/sys
so binds does the job). Now, I want to addnginx-exporter
, but I cannot find my way to reach the host's127.0.0.1:8080/metrics
from within the container.As it is stated in the book that "faasd supports a sub-set of directives in the compose format", I suppose network stuff I tried aren't managed. I'm open to workarounds, but haven't found one yet.
Expected Behaviour
I should be able to access host's network, a way or another.
Current Behaviour
I tried to add the following configs to the nginx-exporter service :
network_mode: "host"
: givesconnect: connection refused
extra_hosts: \n - "host.docker.internal:host-gateway"
: givesdial tcp: lookup host.docker.internal on 8.8.8.8:53: no such host
Your Environment
containerd v1.7.0 faasd 0.16.9 Debian GNU/Linux 11