Convert Netdata to a Compose stack, close #80
This commit is contained in:
parent
85aa718480
commit
728455f42a
|
@ -1,23 +1,12 @@
|
||||||
# vim: ft=yaml.ansible
|
# vim: ft=yaml.ansible
|
||||||
---
|
---
|
||||||
- name: setup netdata docker container for system monitoring
|
- name: Upload Compose file for Netdata
|
||||||
docker_container:
|
template:
|
||||||
name: netdata
|
src: compose-files/netdata.yml.j2
|
||||||
image: netdata/netdata:{{ services.netdata.version }}
|
dest: "{{ services.netdata.volume_folder }}/docker-compose.yml"
|
||||||
restart_policy: unless-stopped
|
|
||||||
hostname: "hevonen.servers.{{ base_domain }}"
|
- name: Deploy Netdata
|
||||||
capabilities:
|
docker_compose:
|
||||||
- SYS_PTRACE
|
project_src: "{{ services.netdata.volume_folder }}"
|
||||||
security_opts:
|
pull: true
|
||||||
- apparmor:unconfined
|
state: present
|
||||||
volumes:
|
|
||||||
- /proc:/host/proc:ro
|
|
||||||
- /sys:/host/sys:ro
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
networks:
|
|
||||||
- name: external_services
|
|
||||||
env:
|
|
||||||
VIRTUAL_HOST : "{{ services.netdata.domain }}"
|
|
||||||
LETSENCRYPT_HOST: "{{ services.netdata.domain }}"
|
|
||||||
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
|
|
||||||
PGID: "999"
|
|
||||||
|
|
36
roles/docker/templates/compose-files/netdata.yml.j2
Normal file
36
roles/docker/templates/compose-files/netdata.yml.j2
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# vim: ft=yaml.docker-compose
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: netdata/netdata:{{ services.netdata.version }}
|
||||||
|
restart: unless-stopped
|
||||||
|
hostname: hevonen.servers.{{ base_domain }}
|
||||||
|
volumes:
|
||||||
|
- "/proc:/host/proc:ro"
|
||||||
|
- "/sys:/host/sys:ro"
|
||||||
|
- "/etc/os-release:/host/etc/os-release:ro"
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
- external_services
|
||||||
|
environment:
|
||||||
|
VIRTUAL_HOST : "{{ services.netdata.domain }}"
|
||||||
|
LETSENCRYPT_HOST: "{{ services.netdata.domain }}"
|
||||||
|
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
|
||||||
|
PGID: "999"
|
||||||
|
DOCKER_HOST: "socket_proxy:2375"
|
||||||
|
cap_add:
|
||||||
|
- SYS_PTRACE
|
||||||
|
security_opt:
|
||||||
|
- apparmor:unconfined
|
||||||
|
|
||||||
|
socket_proxy:
|
||||||
|
image: tecnativa/docker-socket-proxy:latest
|
||||||
|
volumes:
|
||||||
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||||
|
environment:
|
||||||
|
CONTAINERS: 1
|
||||||
|
|
||||||
|
networks:
|
||||||
|
external_services:
|
||||||
|
external: true
|
Loading…
Reference in a new issue