From 53fac6dc2c461f6fb48c2400488b8df172be59aa Mon Sep 17 00:00:00 2001 From: jiooum Date: Mon, 23 Sep 2024 21:42:43 +0700 Subject: [PATCH] [#1] Update: cadvisor --- .github/workflows/deploy.yaml | 4 +++- system_monitoring/config/prometheus.yml | 7 +++++++ system_monitoring/docker-compose.yml | 21 +++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 8a1e7ea..61dddbf 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -8,8 +8,10 @@ jobs: deploy: runs-on: self-hosted steps: + - name: deploy all services + run: docker compose -f system_monitoring/docker-compose.yml up -d - name: deploy prometheus - run: docker compose -f system_monitoring/docker-compose.yml up prometheus -d + run: docker compose -f system_monitoring/docker-compose.yml restart prometheus -d - name: stop grafana run: docker compose -f system_monitoring/docker-compose.yml down grafana - name: deploy grafana diff --git a/system_monitoring/config/prometheus.yml b/system_monitoring/config/prometheus.yml index 076828e..9b3c454 100644 --- a/system_monitoring/config/prometheus.yml +++ b/system_monitoring/config/prometheus.yml @@ -19,3 +19,10 @@ scrape_configs: - job_name: 'nvidia-dcgm-exporter' static_configs: - targets: ['192.168.194.2:9400', '192.168.194.37:9400'] + + - job_name: cadvisor + scrape_interval: 5s + static_configs: + - targets: + - 192.168.194.2:8080 + - 192.168.194.37:8080 diff --git a/system_monitoring/docker-compose.yml b/system_monitoring/docker-compose.yml index 2bbb15f..72caff2 100644 --- a/system_monitoring/docker-compose.yml +++ b/system_monitoring/docker-compose.yml @@ -55,6 +55,27 @@ services: - "9400:9400" networks: - prometheus-network + cadvisor: + image: gcr.io/cadvisor/cadvisor:latest + container_name: pz_cadvisor + ports: + - "8080:8080" + volumes: + - /:/rootfs:ro + - /var/run:/var/run:rw + - /sys:/sys:ro + - /var/lib/docker/:/var/lib/docker:ro + depends_on: + - redis + networks: + - prometheus-network + redis: + image: redis:latest + container_name: pz_redis + ports: + - "6379:6379" + networks: + - prometheus-network networks: prometheus-network: