Fix syslog proxy
Apparently traefik only supports http proxy over connect. https://github.com/traefik/traefik/issues/7803
This commit is contained in:
parent
34a5ce8141
commit
1be855e571
@ -92,13 +92,6 @@ EOF
|
||||
group "syslogng" {
|
||||
count = 1
|
||||
|
||||
constraint {
|
||||
attribute = "${node.unique.name}"
|
||||
# Needs to be on a predictable node for routing
|
||||
# Maybe a loadbalancer could be used for routing from any node
|
||||
value = "n2"
|
||||
}
|
||||
|
||||
network {
|
||||
mode = "bridge"
|
||||
port "main" {
|
||||
@ -113,6 +106,8 @@ EOF
|
||||
connect {
|
||||
sidecar_service {
|
||||
proxy {
|
||||
local_service_port = 514
|
||||
|
||||
upstreams {
|
||||
destination_name = "syslogng-promtail"
|
||||
local_bind_port = 1000
|
||||
@ -128,13 +123,6 @@ EOF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.tcp.routers.syslogngtcp.entrypoints=syslogtcp",
|
||||
"traefik.tcp.routers.syslogngtcp.rule=HostSNI(`*`)",
|
||||
"traefik.udp.routers.syslogngudp.entrypoints=syslogudp",
|
||||
]
|
||||
}
|
||||
|
||||
task "syslogng" {
|
||||
|
@ -32,9 +32,14 @@ job "traefik" {
|
||||
port "web" {
|
||||
static = 80
|
||||
}
|
||||
|
||||
port "websecure" {
|
||||
static = 443
|
||||
}
|
||||
|
||||
port "syslog" {
|
||||
static = 514
|
||||
}
|
||||
}
|
||||
|
||||
ephemeral_disk {
|
||||
@ -224,6 +229,43 @@ CF_ZONE_API_TOKEN={{ .Data.data.api_token_zone_read }}
|
||||
change_mode = "noop"
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOH
|
||||
{{ with service "syslogng" -}}
|
||||
[tcp.routers]
|
||||
[tcp.routers.syslogtcp]
|
||||
entryPoints = ["syslogtcp"]
|
||||
service = "syslogngtcp"
|
||||
rule = "HostSNI(`*`)"
|
||||
|
||||
[tcp.services]
|
||||
[tcp.services.syslogngtcp]
|
||||
[tcp.services.syslogngtcp.loadBalancer]
|
||||
{{ range . -}}
|
||||
[[tcp.services.syslogngtcp.loadBalancer.servers]]
|
||||
address = "{{ .Address }}:{{ .Port }}"
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
|
||||
{{ with service "syslogng" -}}
|
||||
[udp.routers]
|
||||
[udp.routers.syslogudp]
|
||||
entryPoints = ["syslogudp"]
|
||||
service = "syslogngudp"
|
||||
|
||||
[udp.services]
|
||||
[udp.services.syslogngudp]
|
||||
[udp.services.syslogngudp.loadBalancer]
|
||||
{{ range . -}}
|
||||
[[udp.services.syslogngudp.loadBalancer.servers]]
|
||||
address = "{{ .Address }}:{{ .Port }}"
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
EOH
|
||||
destination = "local/config/conf/route-syslog-ng.toml"
|
||||
change_mode = "noop"
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOH
|
||||
[http.middlewares]
|
||||
|
Loading…
Reference in New Issue
Block a user