From d455bbe00e43ffc71ee88ab1f04e9a3ab70b7cbd Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sat, 8 Apr 2023 00:54:13 +0200 Subject: [PATCH] kresd + prometheus: monitor kresd --- playbooks/kresd.yml | 7 +++++++ playbooks/prometheus.yml | 6 ++++++ roles/kresd/defaults/main.yml | 2 ++ roles/kresd/tasks/main.yml | 4 +++- roles/kresd/templates/kresd.conf.j2 | 12 ++++++++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/playbooks/kresd.yml b/playbooks/kresd.yml index d6a9962..1d41fca 100755 --- a/playbooks/kresd.yml +++ b/playbooks/kresd.yml @@ -17,6 +17,13 @@ - address: "::" port: 853 kind: tls + - address: 0.0.0.0 + port: 8453 + kind: webmgmt + - address: "::" + port: 8453 + kind: webmgmt + tls: false kresd__cache_size: 512 roles: - kresd diff --git a/playbooks/prometheus.yml b/playbooks/prometheus.yml index aae43b8..15eb0af 100755 --- a/playbooks/prometheus.yml +++ b/playbooks/prometheus.yml @@ -50,6 +50,12 @@ - prometheus-2.monit.infra.auro.re address: port: 9090 + kresd: + targets: + - dns-1.int.infra.auro.re + - dns-2.int.infra.auro.re + address: + port: 8453 bird: targets: - edge-1.back.infra.auro.re diff --git a/roles/kresd/defaults/main.yml b/roles/kresd/defaults/main.yml index e84d7a5..f0c71cf 100644 --- a/roles/kresd/defaults/main.yml +++ b/roles/kresd/defaults/main.yml @@ -2,3 +2,5 @@ kresd__listen: [] kresd__freebind: true kresd__cache_size: 128 +kresd__prometheus_namespace: "kresd_" +... diff --git a/roles/kresd/tasks/main.yml b/roles/kresd/tasks/main.yml index 7eacdf3..03e15db 100644 --- a/roles/kresd/tasks/main.yml +++ b/roles/kresd/tasks/main.yml @@ -1,7 +1,9 @@ --- - name: Install knot-resolver apt: - name: knot-resolver + name: + - knot-resolver + - knot-resolver-module-http - name: Configure kresd template: diff --git a/roles/kresd/templates/kresd.conf.j2 b/roles/kresd/templates/kresd.conf.j2 index c92309d..b7d21f1 100644 --- a/roles/kresd/templates/kresd.conf.j2 +++ b/roles/kresd/templates/kresd.conf.j2 @@ -16,6 +16,18 @@ modules = { 'hints > iterate', 'stats', 'predict', + 'http', } +{% set webmgmt = kresd__listen + | selectattr("kind", "==", "webmgmt") + | default({}) %} +http.config({ + tls = {{ (webmgmt | first).tls + | default(False) + | ternary('true', 'false') }}, +}, 'webmgmt') + +http.prometheus.namespace = '{{ kresd__prometheus_namespace }}' + cache.size = {{ kresd__cache_size | int }} * MB