Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Passing Config to Container? #10

Open
MattMencel opened this issue Jun 9, 2017 · 1 comment
Open

Passing Config to Container? #10

MattMencel opened this issue Jun 9, 2017 · 1 comment

Comments

@MattMencel
Copy link

OK...sorry for the dumb question...I'm really new to this.

How do I pass my yaml file to the Docker container so it reads the config?

@cristicalin
Copy link

Just butting in as I'm also looking to use this little exporter.
Some README or Makefile would help but in the mean time here is a short intro:

Building:

$ docker build -t vsphere_exporter:latest .

You can pass http_proxy, https_proxy if you need to set them using --build-arg http_proxy and --build-arg https_proxy

Running:
Edit your vsphere_exporter.yml and make sure to set credential appropriately

$ docker run -itd -v $PWD/vsphere_exporter.yml:/vsphere_exporter.yml \
  --name vsphere_exporter -p 9155:9155 vsphere_exporter:latest \
  /go/bin/app -config.file /vsphere_exporter.yml

Depending on how you run your prometheus you may either run it with a link or declare the host IP or docker0 bridge IP in the config. Here's mine just for this experiment:

global:
  scrape_interval:     15s
  external_labels:
    monitor: 'codelab-monitor'

scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'vsphere_exporter'
    scrape_interval: 15s
    static_configs:
      - targets: ['172.17.0.1:9155']

@mjtrangoni mjtrangoni mentioned this issue Jun 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants