Skip to content

Commit

Permalink
[feature] uptime kuma
Browse files Browse the repository at this point in the history
Please note that Kuma is a very simple tools that can be convenient for
a small team but it's not built neither for multi-tenancy[1] nor to be
managed by configuration as code[2].

For now, there are no way to configure a set of monitoring target while
deploying it, and for now there is no backup (but the volume).

[1]: louislam/uptime-kuma#128
[2]: https://www.reddit.com/r/UptimeKuma/comments/1aluk0j/monitors_configuration_as_code/
  • Loading branch information
ponsfrilus committed Mar 19, 2024
1 parent 047c30a commit 5b0872c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
6 changes: 6 additions & 0 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
- noc
- pushgateway

- name: kuma
role: roles/kuma
tags:
- noc
- kuma

- name: mgmt
role: roles/mgmt
tags: mgmt
20 changes: 20 additions & 0 deletions roles/kuma/README-kuma.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Kuma

## About

Uptime Kuma is an easy-to-use self-hosted monitoring tool, similar to uptime
robot but free and open source.

## Install notes

- https://github.com/louislam/uptime-kuma
- https://hub.docker.com/r/louislam/uptime-kuma

```sh
docker run -d \
--restart=always \
-p 3001:3001 \
-v uptime-kuma:/app/data \
--name uptime-kuma \
louislam/uptime-kuma:1
```
32 changes: 32 additions & 0 deletions roles/kuma/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---

- name: Create the Kuma volume
file:
path: "{{ data_path }}/kuma/data"
state: directory

- name: Run Kuma
docker_container:
name: "{{ kuma_container_name }}"
image: "{{ kuma_image_qualified }}"
detach: yes
restart_policy: unless-stopped
recreate: >-
{{
(kuma_config_files is defined and kuma_config_files is changed)
or
(kuma_templates is defined and kuma_templates is changed)
}}
network_mode: "{{ backend_network_name }}"
volumes:
- "{{ data_path }}/kuma/data:/app/data"
log_driver: json-file
log_options:
max-size: 50m
max-file: "3"
labels:
traefik.enable: "true"
traefik.http.routers.kuma.rule: "Host(`kuma.noc{{ dns_suffix }}.{{ frontend.domain }}`)"
traefik.http.routers.kuma.entrypoints: "websecure"
traefik.http.routers.kuma.tls.certresolver: "letsencrypt"
traefik.docker.network: "{{ backend_network_name }}"
7 changes: 7 additions & 0 deletions roles/kuma/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# vars for Kuma
kuma_port: 3001
kuma_container_name: "kuma"
kuma_image: "louislam/uptime-kuma"
kuma_version: "1"
kuma_image_qualified: "{{ kuma_image }}:{{ kuma_version }}"

0 comments on commit 5b0872c

Please sign in to comment.