Просмотр исходного кода

Make prometheus-node-exporter a bit more capable

By running it in a more privileged container with access to the host network stack and such
pull/838/head
Peetz0r 5 лет назад
Родитель
Сommit
76d7e84be5
2 измененных файлов: 6 добавлений и 3 удалений
  1. +5
    -2
      roles/matrix-prometheus-node-exporter/templates/systemd/matrix-prometheus-node-exporter.service.j2
  2. +1
    -1
      roles/matrix-prometheus/templates/prometheus.yml.j2

+ 5
- 2
roles/matrix-prometheus-node-exporter/templates/systemd/matrix-prometheus-node-exporter.service.j2 Просмотреть файл

@@ -21,14 +21,17 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-prometheus-nod
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--network={{ matrix_docker_network }} \
{% if matrix_prometheus_node_exporter_container_http_host_bind_port %}
-p {{ matrix_prometheus_node_exporter_container_http_host_bind_port }}:9100 \
{% endif %}
{% for arg in matrix_prometheus_node_exporter_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ matrix_prometheus_node_exporter_docker_image }}
--net="host" \
--pid="host" \
-v "/:/host:ro,rslave" \
{{ matrix_prometheus_node_exporter_docker_image }} \
--path.rootfs=/host

ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-prometheus-node-exporter 2>/dev/null'
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-prometheus-node-exporter 2>/dev/null'


+ 1
- 1
roles/matrix-prometheus/templates/prometheus.yml.j2 Просмотреть файл

@@ -36,5 +36,5 @@ scrape_configs:
{% if matrix_prometheus_node_exporter_enabled %}
- job_name: node
static_configs:
- targets: ['matrix-prometheus-node-exporter:9100']
- targets: ['172.18.0.1:9100']
{% endif %}

Загрузка…
Отмена
Сохранить