Repository navigation
Closed
Description
Hi!
I was playing a bit with sozu yesterday. I had a configuration file like this:
#...
[applications]
[applications.ingress]
hostname = "sozu"
path_begin = "/api/v0/update"
backends = [ "ingress:8080" ]
[applications.egress]
hostname = "sozu"
path_begin = "/api/v0/exec"
backends = [ "egress:8080" ]Here's the log:
sozu | 2018-02-15T15:05:08Z 51870899701997 1 MASTER INFO starting up
sozu | 2018-02-15T15:05:08Z 51870922854097 1 MASTER INFO 0 launching worker
sozu | 2018-02-15T15:05:08Z 51870923186297 1 MASTER INFO 0 worker launched: 6
sozu | 7 send empty
sozu | 2018-02-15T15:05:08Z 51870923594997 1 MASTER INFO sent listeners from master: Ok(())
sozu | 2018-02-15T15:05:08Z 51870926268397 1 MASTER INFO 1 launching worker
sozu | 2018-02-15T15:05:08Z 51870926630997 1 MASTER INFO 1 worker launched: 7
sozu | 9 send empty
sozu | 2018-02-15T15:05:08Z 51870927136197 1 MASTER INFO sent listeners from master: Ok(())
sozu | 2018-02-15T15:05:08Z 51870927216397 1 MASTER INFO created workers: [Worker { id: 0, run_state: Running }, Worker { id: 1, run_state: Running }]
sozu | 2018-02-15T15:05:08Z 51870927462697 1 MASTER ERROR could not get saved state path: No such file or directory (os error 2)
sozu | 2018-02-15T15:05:08Z 51870939343597 7 WRK-01 INFO worker 1 starting...
sozu | 2018-02-15T15:05:08Z 51870945467597 6 WRK-00 INFO worker 0 starting...
sozu | 2018-02-15T15:05:08Z 51871060998497 7 WRK-01 INFO will try to receive listeners
sozu | 10 received :(35, 0)
sozu | 2018-02-15T15:05:08Z 51871061689697 7 WRK-01 INFO received listeners: Some(
sozu | Listeners {
sozu | http: None,
sozu | tls: None,
sozu | tcp: []
sozu | }
sozu | )
sozu | 2018-02-15T15:05:08Z 51871062593397 7 WRK-01 ERROR Couldn't parse address of HTTP proxy: invalid IP address syntax
sozu | 2018-02-15T15:05:08Z 51871064190197 1 MASTER ERROR could not parse address: egress:8080
sozu | 2018-02-15T15:05:08Z 51871071132097 7 WRK-01 INFO 1 starting event loop
sozu | 2018-02-15T15:05:08Z 51871088278097 1 MASTER INFO waiting for configuration client connections
As I was playing with sozu with docker-compose using links, I don't have to use IPs. From what I see in the log could not parse address: egress:8080 doesn't seems to be parsed into an IPv4 address.
Am i right? If so, is it possible to add the possibility to resolve domain using /etc/hosts file?
As I am always looking for new challenges, if it's an easy PR, I would love to give it a try!
Activity
Geal commentedon Feb 15, 2018
Hello,
The feature is a bit tricky, because we must think about where and how often the name check happens. The various solutions:
/etc/hosts) and a small state to keep aroundIn the configuration messages, do we make an enum
domain/IPto identify a backend?The
lookup_hostfeature in libstd is only available on nightly. Or do we embed a DNS client in sozu? TrustDNS is nicely designed.Geal commentedon Jul 29, 2021
we should do this now
Keksoj commentedon Jun 7, 2023
Hello everyone. Is this still a thing? Do people want this? ping @PierreZ
taladar commentedon Oct 30, 2024
How do you even run sozu in a Docker Compose or Kubernetes environment without this?
NeilujD commentedon Oct 31, 2024
in docker compose you can define a network with static ip addresses.
lzpel commentedon Oct 4, 2025
this is my quick workaround (works fine in Docker Compose)
I just let make render the config at startup and resolve service names into IPs
docker-compose.yml
Makefile
Why this? Because in Compose the service names (
api,frontend) resolve nicely inside the network; I just turn them into IPs once at startup and bake them into the config.feat(config): resolve backend names on file load
fix(config): keep control commands independent of DNS
fix(config): reject unbracketed IPv6 backends
feat(config): reconcile backend DNS with main