Sorry to say but there is still an issue with reverse proxy:
adminer.example.com {
route {
authorize with mypolicy
reverse_proxy {
# to srv+http://adminer.service.consul
dynamic srv {
name service.consul
service adminer
proto tcp
refresh 10s
resolvers 172.17.0.1:53
dial_timeout 1s
dial_fallback_delay -1s
}
}
}
}
results in:
{"level":"debug","ts":1651850474.5743804,"logger":"http.reverse_proxy.upstreams.srv","msg":"refreshing SRV upstreams","service":"adminer","proto":"tcp","name":"service.consul"}
{"level":"error","ts":1651850474.5781791,"logger":"http.handlers.reverse_proxy","msg":"failed getting dynamic upstreams; falling back to static upstreams","error":"lookup _adminer._tcp.service.consul on 172.17.0.1:53: server misbehaving"}
Then I tried:
adminer.example.com {
route {
reverse_proxy {
# to srv+http://adminer.service.consul
dynamic srv adminer.service.consul {
refresh 10s
resolvers 172.17.0.1:53
dial_timeout 1s
dial_fallback_delay -1s
}
}
}
}
results in:
{"level":"debug","ts":1651851023.367271,"logger":"http.reverse_proxy.upstreams.srv","msg":"refreshing SRV upstreams","service":"","proto":"","name":"adminer.service.consul"}
{"level":"error","ts":1651851023.3705013,"logger":"http.handlers.reverse_proxy","msg":"failed getting dynamic upstreams; falling back to static upstreams","error":"lookup adminer.service.consul on 172.17.0.1:53: server misbehaving"}
not sure what is failing here. But what I want it to query is:
dig +short srv adminer.service.consul
1 1 22766 0a170c95.addr.preprod.consul.
I looked into the code base on the comments int he code, the second example should work, right?