Skip to content

Commit

Permalink
update port
Browse files Browse the repository at this point in the history
  • Loading branch information
xanhacks committed Oct 26, 2024
1 parent 2dc8af8 commit 1dc0ab2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
24 changes: 20 additions & 4 deletions ansible/roles/monitoring/files/docker-compose.panel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ services:

cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.50.0
restart: unless-stopped
container_name: cadvisor
restart: unless-stopped
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
Expand All @@ -13,10 +13,26 @@ services:
networks:
- monitoring_net

node-exporter:
image: prom/node-exporter:latest
container_name: node_exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
networks:
- monitoring_net

prometheus:
image: prom/prometheus:main
restart: unless-stopped
container_name: prometheus
restart: unless-stopped
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
Expand All @@ -30,15 +46,15 @@ services:

grafana:
image: grafana/grafana:main
restart: unless-stopped
container_name: grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
volumes:
- ./datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
ports:
- "9100:3000"
- "9000:3000"
depends_on:
- prometheus
networks:
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/monitoring/templates/prometheus.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ scrape_configs:
- job_name: "cadvisor"
static_configs:
- targets: ["cadvisor:8080", "35.180.196.232:8080" {{ ip_addresses }}]

- job_name: "node"
static_configs:
- targets: ["node_exporter:9100"]
2 changes: 1 addition & 1 deletion terraform/firewall.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ resource "linode_firewall" "deploy_dynamic_firewall" {
label = "allow-grafana"
action = "ACCEPT"
protocol = "TCP"
ports = "9100"
ports = "9000"
ipv4 = ["0.0.0.0/0"]
ipv6 = ["::/0"]
}
Expand Down

0 comments on commit 1dc0ab2

Please sign in to comment.