-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathcadvisor.service.j2
More file actions
57 lines (51 loc) · 1.82 KB
/
cadvisor.service.j2
File metadata and controls
57 lines (51 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{{ ansible_managed | comment }}
[Unit]
Description=cAdvisor cgroup/container metrics server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User={{ cadvisor_system_user }}
Group={{ cadvisor_system_group }}
ExecStart={{ cadvisor_binary_install_dir }}/cadvisor \
{% if cadvisor_disable_metrics | length > 0 %}
'--disable_metrics={{ cadvisor_disable_metrics | join(',') }}' \
{% endif -%}
{% if cadvisor_enable_metrics | length > 0 %}
'--enable_metrics={{ cadvisor_enable_metrics | join(',') }}' \
{% endif -%}
{% if cadvisor_docker_only %}
'--docker_only={{ cadvisor_docker_only | lower }}' \
{% endif -%}
{% if cadvisor_whitelisted_container_labels | length > 0 %}
'--whitelisted_container_labels={{ cadvisor_whitelisted_container_labels | join(',') }}' \
{% endif -%}
{% if cadvisor_env_metadata_whitelist | length > 0 %}
'--env_metadata_whitelist={{ cadvisor_env_metadata_whitelist | join(',') }}' \
{% endif %}
{% if cadvisor_basic_auth_users | length > 0 %}
'--http_auth_file={{ cadvisor_config_dir }}/htpasswd' \
'--http_auth_realm=cadvisor' \
{% endif %}
'--store_container_labels={{ cadvisor_store_container_labels | lower }}' \
'--listen_ip={{ cadvisor_listen_ip }}' \
'--port={{ cadvisor_port }}' \
'--prometheus_endpoint={{ cadvisor_prometheus_endpoint }}'
'--housekeeping_interval={{ cadvisor_housekeeping_interval }}'
'--max_housekeeping_interval={{ cadvisor_max_housekeeping_interval }}'
SyslogIdentifier=cadvisor
Restart=always
RestartSec=1
StartLimitInterval=0
ProtectHome=yes
NoNewPrivileges=yes
{% if (ansible_facts.packages.systemd | first).version is version('232', '>=') %}
ProtectSystem=strict
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=yes
{% else %}
ProtectSystem=full
{% endif %}
[Install]
WantedBy=multi-user.target