feat: add dns container with AGH + unbound

This commit is contained in:
Xavier Morel
2025-10-23 22:13:43 +02:00
parent 0d343b12a3
commit 16b9271caf
6 changed files with 210 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
{ ip, domainname, ... }:
{
out = ''
loki.relabel "unbd_journal" {
forward_to = []
rule {
source_labels = ["__journal__priority_keyword"]
target_label = "level"
}
rule {
source_labels = ["__journal__SYSLOG_IDENTIFIER"]
target_label = "app"
}
}
loki.source.journal "unbd_journal_scrape" {
forward_to = [loki.process.unbd_router.receiver]
matches = "_SYSTEMD_UNIT=unbound.service"
relabel_rules = loki.relabel.unbd_journal.rules
labels = {
service = "unbound",
host = "${domainname}",
host_ip = "${ip}",
}
}
loki.process "unbound_router" {
stage.pattern {
pattern = "[<_>] <level>: <message>"
}
stage.labels {
values = {
level = "level",
}
}
stage.output {
source = "message"
}
forward_to = [loki.write.grafana_loki.receiver]
}
'';
}