From 0ceea3895e5911c6c973a201087fa1afe461d3d6 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 13 Jan 2024 17:43:23 +0200 Subject: [PATCH] Move all monitoring-related services to their own container network (`matrix_monitoring_container_network`) --- group_vars/matrix_servers | 10 +++++----- roles/custom/matrix-base/defaults/main.yml | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 449d7bd8c..d3e2abcad 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -4439,7 +4439,7 @@ prometheus_node_exporter_gid: "{{ matrix_user_gid }}" prometheus_node_exporter_hostname: "{{ matrix_server_fqn_matrix }}" -prometheus_node_exporter_container_network: "{{ matrix_docker_network }}" +prometheus_node_exporter_container_network: "{{ matrix_monitoring_container_network }}" prometheus_node_exporter_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [] }}" @@ -4475,7 +4475,7 @@ prometheus_postgres_exporter_gid: "{{ matrix_user_gid }}" prometheus_postgres_exporter_hostname: "{{ matrix_server_fqn_matrix }}" -prometheus_postgres_exporter_container_network: "{{ matrix_docker_network }}" +prometheus_postgres_exporter_container_network: "{{ matrix_monitoring_container_network }}" prometheus_postgres_exporter_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [] }}" @@ -4516,7 +4516,7 @@ matrix_prometheus_nginxlog_exporter_identifier: matrix-prometheus-nginxlog-expor matrix_prometheus_nginxlog_exporter_hostname: "{{ matrix_server_fqn_matrix }}" -matrix_prometheus_nginxlog_exporter_container_network: matrix-prometheus-nginxlog-exporter +matrix_prometheus_nginxlog_exporter_container_network: "{{ matrix_monitoring_container_network }}" matrix_prometheus_nginxlog_exporter_container_labels_traefik_enabled: "{{ matrix_metrics_exposure_enabled }}" matrix_prometheus_nginxlog_exporter_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" @@ -4658,7 +4658,7 @@ grafana_hostname: "{{ matrix_server_fqn_grafana }}" grafana_base_path: "{{ matrix_base_data_path }}/grafana" -grafana_container_network: "{{ matrix_nginx_proxy_container_network if matrix_playbook_reverse_proxy_type == 'playbook-managed-nginx' else grafana_identifier }}" +grafana_container_network: "{{ matrix_monitoring_container_network }}" grafana_container_additional_networks: | {{ @@ -4685,7 +4685,7 @@ grafana_provisioning_datasources: | 'name': (matrix_server_fqn_matrix + ' - Prometheus'), 'type': 'prometheus', 'access': 'proxy', - 'url': 'http://matrix-prometheus:9090', + 'url': ('http://' + prometheus_identifier + ':9090'), }] if prometheus_enabled else []) }} diff --git a/roles/custom/matrix-base/defaults/main.yml b/roles/custom/matrix-base/defaults/main.yml index 1905b170d..04020753f 100644 --- a/roles/custom/matrix-base/defaults/main.yml +++ b/roles/custom/matrix-base/defaults/main.yml @@ -31,6 +31,9 @@ matrix_addons_homeserver_client_api_url: "{{ matrix_homeserver_container_url }}" # The systemd services (representing the homeserver) that addon services (bridges, bots, etc.) should depend on matrix_addons_homeserver_systemd_services_list: "{{ matrix_homeserver_systemd_services_list }}" +# A container network where all monitoring services would live. +matrix_monitoring_container_network: matrix-monitoring + # matrix_homeserver_enabled controls whether to enable the homeserver systemd service, etc. # # Unless you're wrapping this playbook in another one