diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml new file mode 100644 index 00000000..733140c3 --- /dev/null +++ b/.idea/jsonSchemas.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/infrastructure/layers/self-managed/11_monitoring/compose.yaml b/infrastructure/layers/self-managed/11_monitoring/compose.yaml new file mode 100644 index 00000000..e7d22401 --- /dev/null +++ b/infrastructure/layers/self-managed/11_monitoring/compose.yaml @@ -0,0 +1,98 @@ +name: monitoring +services: + grafana: + image: grafana/grafana + user: '472' + restart: always + environment: + - GF_INSTALL_PLUGINS=grafana-clock-panel + - GF_RENDERING_SERVER_URL=http://renderer:8081/render + - GF_RENDERING_CALLBACK_URL=http://grafana:3000/ + volumes: + - grafana_data:/var/lib/grafana + - ./grafana/provisioning/:/etc/grafana/provisioning/ + env_file: + - ./grafana/config.monitoring + ports: + - 3000:3000 + depends_on: + - prometheus + networks: + - monitoring + + renderer: + image: grafana/grafana-image-renderer:latest + ports: + - 8081 + networks: + - monitoring + + prometheus: + image: prom/prometheus + restart: always + volumes: + - ./prometheus:/etc/prometheus/ + - prometheus_data:/prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/prometheus' + - '--web.console.libraries=/usr/share/prometheus/console_libraries' + - '--web.console.templates=/usr/share/prometheus/consoles' + depends_on: + - node-exporter + - cadvisor + networks: + - monitoring + + node-exporter: + image: prom/node-exporter + volumes: + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro + command: + - '--path.procfs=/host/proc' + - '--path.sysfs=/host/sys' + - --collector.filesystem.ignored-mount-points + - '^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)' + ports: + - 9100:9100 + restart: always + privileged: true + deploy: + mode: global + networks: + - monitoring + + cadvisor: + image: gcr.io/cadvisor/cadvisor + container_name: cadvisor + privileged: true + cgroup: host + userns_mode: "host" + ipc: private + shm_size: 128M + expose: + - "8080" + networks: + - monitoring + volumes: + - /:/rootfs:ro + - /var/run:/var/run:rw + - /sys:/sys:ro + - /var/lib/docker/:/var/lib/docker:ro + - /dev/disk/:/dev/disk:ro + # Fucking cgroup bullshit + - /sys/fs/cgroup:/sys/fs/cgroup:ro + deploy: + mode: global + +networks: + monitoring: + name: monitoring + +volumes: + grafana_data: + name: "grafana_data" + prometheus_data: + name: "prometheus_data" \ No newline at end of file diff --git a/infrastructure/layers/self-managed/docker-compose.yml b/infrastructure/layers/self-managed/docker-compose.yml index 79039be8..13650a75 100644 --- a/infrastructure/layers/self-managed/docker-compose.yml +++ b/infrastructure/layers/self-managed/docker-compose.yml @@ -111,36 +111,6 @@ services: - docker_proxy # ---------------------------------------- - # Server Dashboard - # ---------------------------------------- - # There is a need for two dashboards, the one - # for the public network and people who ten use - # my infrastructure and applications and - # the second one for the internal network and - # mostly myself. - # - # https://github.com/ProductiveOps/dokemon - # https://github.com/louislam/dockge?tab=readme-ov-file - # https://github.com/hywax/mafl - # https://github.com/ordinary-dev/phoenix - # ---------------------------------------- - homepage: - image: ghcr.io/gethomepage/homepage:latest - container_name: homepage - labels: - - "traefik.enable=true" - - "traefik.http.routers.homepage.rule=PathPrefix(`/`)" - - "traefik.http.routers.homepage.entrypoints=http" - ports: - - 3010:3000 - volumes: - - type: bind - source: ./homepage - target: /app/config - networks: - - docker_proxy - - reverse_proxy - # ---------------------------------------- # ---------------------------------------- # Object Storage @@ -331,117 +301,6 @@ services: # TODO: IPFS # ---------------------------------------- - # ---------------------------------------- - # Observability Services - # ---------------------------------------- - # These are the core services that are required - # to run the application. - # ---------------------------------------- - prometheus: - image: prom/prometheus - restart: always - labels: - - "traefik.enable=true" - - "traefik.http.routers.prometheus.rule=Host(`prometheus.${DOMAIN}`)" - - "traefik.http.services.prometheus.loadbalancer.server.port=9090" - - "traefik.http.routers.prometheus.entrypoints=http" - volumes: - - ./prometheus:/etc/prometheus/ - - prometheus_data:/prometheus - command: - - '--config.file=/etc/prometheus/prometheus.yml' - - '--storage.tsdb.path=/prometheus' - - '--web.console.libraries=/usr/share/prometheus/console_libraries' - - '--web.console.templates=/usr/share/prometheus/consoles' - depends_on: - - node-exporter - - cadvisor - deploy: - resources: *resource-preset-x025 - restart_policy: *restart_policy - networks: - - monitoring - - node-exporter: - image: prom/node-exporter - volumes: - - /proc:/host/proc:ro - - /sys:/host/sys:ro - - /:/rootfs:ro - command: - - '--path.procfs=/host/proc' - - '--path.sysfs=/host/sys' - - --collector.filesystem.ignored-mount-points - - '^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)' - ports: - - 9100:9100 - restart: always - deploy: - mode: global - resources: *resource-preset-x025 - restart_policy: *restart_policy - networks: - - monitoring - - # https://gvisor.dev/ - cadvisor: - image: gcr.io/cadvisor/cadvisor - container_name: cadvisor - privileged: true - cgroup: host - userns_mode: "host" - ipc: private - shm_size: 128M - expose: - - "8080" - networks: - - monitoring - volumes: - - /:/rootfs:ro - - /var/run:/var/run:rw - - /sys:/sys:ro - - /var/lib/docker/:/var/lib/docker:ro - - /dev/disk/:/dev/disk:ro - # Fucking cgroup bullshit - - /sys/fs/cgroup:/sys/fs/cgroup:ro - deploy: - mode: global - resources: *resource-preset-x025 - restart_policy: *restart_policy - - grafana: - image: grafana/grafana - user: '472' - restart: always - environment: - - GF_INSTALL_PLUGINS=grafana-clock-panel - - GF_RENDERING_SERVER_URL=http://renderer:8081/render - - GF_RENDERING_CALLBACK_URL=http://grafana:3000/ - volumes: - - grafana_data:/var/lib/grafana - - ./grafana/provisioning/:/etc/grafana/provisioning/ - env_file: - - 11_monitoring/grafana/config.monitoring - ports: - - 3000:3000 - depends_on: - - prometheus - deploy: - resources: *resource-preset-x025 - restart_policy: *restart_policy - networks: - - monitoring - - renderer: - image: grafana/grafana-image-renderer:latest - ports: - - 8081 - deploy: - resources: *resource-preset-x025 - restart_policy: *restart_policy - networks: - - monitoring - # TODO: HyperDX # TODO: Grafana # TODO: Prometheus