Skip to content

Commit

Permalink
feat: add cadvisor
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-Tiz committed Jul 2, 2024
1 parent 72405a3 commit 55fab67
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
60 changes: 60 additions & 0 deletions templates/group_vars_mash_servers
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ mash_playbook_devture_systemd_service_manager_services_list_auto_itemized:
{{ ({'name': (authelia_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'authelia']} if authelia_enabled else omit) }}
# /role-specific:authelia

# role-specific:cadvisor
- |-
{{ ({'name': (cadvisor_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'metrics', 'prometheus-node-exporter']} if cadvisor_enabled else omit) }}
# /role-specific:cadvisor

# role-specific:calibre-web
- |-
{{ ({'name': (calibre_web_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'calibre-web']} if calibre_web_enabled else omit) }}
Expand Down Expand Up @@ -1596,6 +1601,61 @@ wetty_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolve



# role-specific:cadvisor
########################################################################
# #
# cadvisor #
# #
########################################################################

cadvisor_enabled: false

cadvisor_identifier: "{{ mash_playbook_service_identifier_prefix }}prometheus-node-exporter"

cadvisor_hostname: "{{ mash_playbook_metrics_exposure_hostname }}"
cadvisor_path_prefix: "{{ mash_playbook_metrics_exposure_path_prefix }}/{{ cadvisor_identifier }}"

cadvisor_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}prometheus-node-exporter"

cadvisor_uid: "{{ mash_playbook_uid }}"
cadvisor_gid: "{{ mash_playbook_gid }}"

cadvisor_container_additional_networks: |
{{
([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else [])
}}

# Only enable Traefik labels if a hostname is set (indicating that this will be exposed publicly)
cadvisor_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled and cadvisor_hostname }}"
cadvisor_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}"
cadvisor_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}"
cadvisor_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}"

cadvisor_container_labels_metrics_middleware_basic_auth_enabled: "{{ mash_playbook_metrics_exposure_http_basic_auth_enabled }}"
cadvisor_container_labels_metrics_middleware_basic_auth_users: "{{ mash_playbook_metrics_exposure_http_basic_auth_users }}"

cadvisor_container_extra_arguments_auto:
- "--mount type=bind,source=/,destination=/rootfs,readonly"
- "--mount type=bind,source=/var/run,destination=/var/run,readonly"
- "--mount type=bind,source=/sys,destination=/sys,readonly"
- "--mount type=bind,source=/var/lib/docker/,destination=/var/lib/docker,readonly"
- "--mount type=bind,source=/dev/disk/,destination=/dev/disk,readonly"
- "--mount type=bind,source=/dev/kmsg,target=/dev/kmsg"



cadvisor_process_extra_arguments_auto:
- "--url_base_prefix={{ cadvisor_container_labels_traefik_path_prefix }}"

########################################################################
# #
# /cadvisor #
# #
########################################################################
# /role-specific:cadvisor



# role-specific:calibre-web
########################################################################
# #
Expand Down
4 changes: 4 additions & 0 deletions templates/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
version: v1.2.8-1.8.12-1
name: backup_borg
activation_prefix: backup_borg_
- src: git+https://github.com/sudo-Tiz/ansible-role-cadvisor.git
version: main
name: cadvisor
activation_prefix: cadvisor_
- src: git+https://github.com/lingawakad/ansible-role-calibre-web.git
version: v0.6.21-1
name: calibre-web
Expand Down

0 comments on commit 55fab67

Please sign in to comment.