-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
415 additions
and
140 deletions.
There are no files selected for viewing
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
provision/files/grafana/provisioning/datasrouces/prometheus.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
access: proxy | ||
url: http://prometheus:9090 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
local ansible_connection=local ansible_python_interpreter=/usr/bin/python3 | ||
local ansible_connection=local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
- import_tasks: 'traefik.yml' | ||
tags: 'traefik' | ||
|
||
- import_tasks: 'portainer.yml' | ||
tags: 'portainer' | ||
|
||
- name: Create monitoring network | ||
community.docker.docker_network: | ||
name: monitoring | ||
state: present | ||
tags: ['docker-monitoring-stack'] | ||
|
||
- import_tasks: 'grafana.yml' | ||
tags: ['grafana', 'docker-monitoring-stack'] | ||
|
||
- import_tasks: 'loki.yml' | ||
tags: ['loki', 'docker-monitoring-stack'] | ||
|
||
- import_tasks: 'promtail.yml' | ||
tags: ['promtail', 'docker-monitoring-stack'] | ||
|
||
- import_tasks: 'cadvisor.yml' | ||
tags: ['cadvisor', 'docker-monitoring-stack'] | ||
|
||
- import_tasks: 'prometheus.yml' | ||
tags: ['prometheus', 'docker-monitoring-stack'] | ||
|
||
- import_tasks: 'node-exporter.yml' | ||
tags: ['node-exporter', 'docker-monitoring-stack'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- name: cAdvisor | Start container | ||
community.docker.docker_container: | ||
name: cadvisor | ||
image: gcr.io/cadvisor/cadvisor:v0.47.2 | ||
command: --docker_only=true | ||
state: started | ||
restart_policy: "unless-stopped" | ||
networks: | ||
- name: monitoring | ||
- name: traefik-public | ||
volumes: | ||
- /:/rootfs:ro | ||
- /var/run:/var/run:ro | ||
- /sys:/sys:ro | ||
- /var/lib/docker/:/var/lib/docker:ro | ||
- /dev/kmsg:/dev/kmsg | ||
labels: | ||
traefik.enable: "true" | ||
traefik.http.routers.cadvisor.rule: "Host(`cadvisor.docker`)" | ||
traefik.http.routers.cadvisor.entrypoints: "web" | ||
traefik.http.services.cadvisor.loadbalancer.server.port: "8080" | ||
traefik.docker.network: traefik-public | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
- name: Grafana | Create persistent volume | ||
community.docker.docker_volume: | ||
name: grafana-storage | ||
state: present | ||
|
||
- name: Grafana | Create Configuration folder | ||
ansible.builtin.copy: | ||
src: grafana/ | ||
dest: /etc/grafana | ||
become: true | ||
|
||
- name: Grafana | Start Container | ||
community.docker.docker_container: | ||
name: grafana | ||
image: grafana/grafana:10.1.0 | ||
state: started | ||
restart_policy: "unless-stopped" | ||
networks: | ||
- name: monitoring | ||
- name: traefik-public | ||
volumes: | ||
- "grafana-storage:/var/lib/grafana" | ||
- "/etc/grafana/provisioning:/etc/grafana/provisioning" | ||
labels: | ||
traefik.enable: "true" | ||
traefik.docker.network: traefik-public | ||
traefik.http.routers.grafana.rule: "Host(`grafana.docker`)" | ||
traefik.http.routers.grafana.tls: "true" | ||
traefik.http.routers.grafana.entrypoints: "websecure" | ||
traefik.http.services.grafana.loadbalancer.server.port: "3000" | ||
healthcheck: | ||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/api/health"] | ||
interval: 10s | ||
timeout: 2s | ||
retries: 3 | ||
start_period: 10s | ||
env: | ||
GF_AUTH_ANONYMOUS_ENABLED: "true" | ||
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin" | ||
GF_AUTH_ANONYMOUS_ORG_NAME: "Main Org." | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
- name: Loki | Ensure Configuration folder exists | ||
ansible.builtin.file: | ||
path: /etc/loki | ||
state: directory | ||
mode: '0755' | ||
become: true | ||
|
||
- name: Loki | Ensure Configuration file exists | ||
ansible.builtin.template: | ||
src: loki/loki-local-config.yaml.j2 | ||
dest: /etc/loki/config.yaml | ||
become: true | ||
|
||
- name: Loki | Ensure data volume exists | ||
community.docker.docker_volume: | ||
name: loki-storage | ||
state: present | ||
|
||
- name: Loki | Start container | ||
community.docker.docker_container: | ||
name: loki | ||
image: grafana/loki:2.8.4 | ||
state: started | ||
command: -config.file=/etc/loki/config.yaml | ||
labels: | ||
traefik.enable: "false" | ||
networks: | ||
- name: monitoring | ||
restart_policy: "unless-stopped" | ||
volumes: | ||
- /etc/loki/config.yaml:/etc/loki/config.yaml | ||
- loki-storage:/loki | ||
healthcheck: | ||
test: ["CMD", "wget", "-qO-", "http://localhost:3100/ready"] | ||
interval: 10s | ||
timeout: 2s | ||
retries: 3 | ||
start_period: 10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
- name: Node Exporter | Start Container | ||
community.docker.docker_container: | ||
name: node-exporter | ||
image: prom/node-exporter:v1.6.1 | ||
command: | ||
- '--path.procfs=/host/proc' | ||
- '--path.rootfs=/rootfs' | ||
- '--path.sysfs=/host/sys' | ||
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)' | ||
state: started | ||
restart_policy: "unless-stopped" | ||
networks: | ||
- name: monitoring | ||
volumes: | ||
- /proc:/host/proc:ro | ||
- /sys:/host/sys:ro | ||
- /:/rootfs:ro | ||
labels: | ||
traefik.enable: "false" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.