Small cleanups

This commit is contained in:
Daniel Berteaud 2024-03-26 09:18:19 +01:00
parent 30ea92783c
commit 348aa7cbf6
5 changed files with 35 additions and 8 deletions

Binary file not shown.

View File

@ -2037,7 +2037,6 @@ _EOT
network {
mode = "bridge"
port "syslog-udp" {}
port "metrics" {}
}
@ -2093,6 +2092,7 @@ _EOT
task "vector" {
driver = "docker"
leader = true
config {
image = "danielberteaud/vector:0.36.1-1"

View File

@ -484,7 +484,12 @@ _EOT
network {
mode = "bridge"
port "syslog-udp" {}
[[- if $c.syslog_udp.enabled ]]
port "syslog_udp" {}
[[- end ]]
[[- if $c.syslog_tcp.enabled ]]
port "syslog_tcp" {}
[[- end ]]
port "metrics" {}
}
@ -505,11 +510,21 @@ _EOT
# devices, and can be exposed by Traefik for this
service {
name = "syslog-udp[[ .consul.suffix ]]"
port = "syslog-udp"
port = "syslog_udp"
tags = [
[[ template "common/traefik_tags" merge $c.syslog_udp $c ]]
# UDP services can't be used through the mesh
"[[ $c.traefik.instance ]].consulcatalog.connect=false"
]
}
[[- end ]]
[[- if $c.syslog_tcp.enabled ]]
# The syslog TCP service can be used to ingest standard syslog logs from other
# devices, and can be exposed by Traefik for this
service {
name = "syslog-tcp[[ .consul.suffix ]]"
port = "syslog_tcp"
tags = [
[[ template "common/traefik_tags" merge $c.syslog_tcp $c ]]
]
}
[[- end ]]
@ -517,7 +532,7 @@ _EOT
[[- if $c.fluentd.enabled ]]
# The fluentd service can be used to ingest fluentd logs
service {
name = "syslog-udp[[ .consul.suffix ]]"
name = "fluent[[ .consul.suffix ]]"
port = 24224
tags = [
[[ template "common/traefik_tags" merge $c.fluentd $c ]]
@ -527,6 +542,7 @@ _EOT
task "vector" {
driver = "[[ $c.nomad.driver ]]"
leader = true
config {
image = "[[ $c.image ]]"

View File

@ -11,16 +11,25 @@ sources:
type: internal_metrics
[[- if .syslog_udp.enabled ]]
logs_syslog_udp:
type: syslog
mode: udp
address: 0.0.0.0:{{{ env "NOMAD_ALLOC_PORT_syslog_udp" }}}
address: 0.0.0.0:${NOMAD_ALLOC_PORT_syslog_udp}
[[- end ]]
[[- if .syslog_tcp.enabled ]]
logs_syslog_tcp:
type: syslog
mode: tcp
address: 0.0.0.0:${NOMAD_ALLOC_PORT_syslog_tcp}
[[- end ]]
[[- if .fluentd.enabled ]]
logs_fluentd:
type: fluent
address: 127.0.0.1:24224
address: "127.0.0.1:24224"
[[- end ]]
transforms:

View File

@ -301,6 +301,7 @@ monitoring:
enabled: false
traefik:
router: syslog-udp
proto: udp
entrypoints:
- syslog-udp
# Syslog (tcp) source settings
@ -308,6 +309,7 @@ monitoring:
enabled: false
traefik:
router: syslog-tcp
proto: tcp
entrypoints:
- syslog-tcp
# Native vector (http) source settings