-
K8S 환경에서 Container monitoring하기 ( cAdvisor + Prometheus + Grafana )Infrastructure/Kubenetes 2020. 11. 18. 18:24728x90
개념에 대해서는 알만한 사람은 다아시는 조대협님 블로그를 참고했고요. 그외 참고한 블로그 링크를 남깁니다.
https://bcho.tistory.com/1270쿠버네티스 #14 - 모니터링 (2/3) Prometheus
쿠버네티스 #14 모니터링 2/3 Prometheus를 이용한 모니터링 조대협 (http://bcho.tistory.com) 프로메테우스 그동안 주요 모니터링 솔루션으로 사용되던 힙스터는 1.13 버전 이후로 deprecated 될 예정이고, 그.
bcho.tistory.com
CAdvisor + Prometheus + Grafana 를 이용한 컨테이너 모니터링 – imbang.net
도커 호스트 서버의 모니터링은 기존 상용 모니터링 툴에서 제공하는 모니터링으로도 충분히 모니터링이 가능 했다. 하지만 호스트 서버의 각 컨테이너들이 사용하는 리소스를 모니터링 할 수
imbang.net
https://waspro.tistory.com/569
[Monitoring] Prometheus & Grafana를 활용한 자원 사용률 모니터링
본 포스팅에서는 Prometheus와 Grafana를 활용한 자원 사용률 모니터링 방법에 대해 알아보겠습니다. 시스템을 구축하고 운영할 때 시스템을 구성하는 요소들의 조화로운 설계도 중요하지만, 모니터
waspro.tistory.com
-cAdvioser설치
sudo docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=8080:8080 --detach=true --name=cadvisor google/cadvisor:latest- Node-Exporter설치
sudo docker run -d --name node-exporter -p 9100:9100 --restart=unless-stopped prom/node-exporter:v0.14.0- Prometheus 구성
- 설정파일 작성
## prometheus-cadvisor.ymlscrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: cadvisor # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: 5s # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: [ 'cadvisor:8080', 'node-exporter:9100' ]
- 컨테이너 생성
sudo docker run -d --name prometheus-cadvisor -h prometheus-cadvisor -p 9090:9090 --link cadvisor:cadvisor --link node-exporter:node-exporter -v $(pwd)/prometheus-cadvisor.yml:/etc/prometheus/prometheus.yml prom/prometheus:v1.7.0 -config.file=/etc/prometheus/prometheus.yml- Grafana 구성 및 연동
- 컨테이너 생성
sudo docker run -d --name grafana -h grafana -e GF_SECURITY_ADMIN_PASSWORD=platform -p 3000:3000 --link prometheus-cadvisor:prometheus-cadvisor grafana/grafana:4.4.3