So I have two backend services I want to communicate over the private network (dns name <appname>.internal).
Everything works fine when the target is online, but when it is offline/scaled to zero, the dns lookup fails, and I am forced to use the public domain name instead (<appname>.fly.dev).
This is intentional? and if so: Does scaling also only work for public requests?
Since the concurrency config is on the internal port in service configuration, I would assume scaling should work on internal requests as well… but it doesn’t seem to work correctly, at least not the dns lookup :S
Thanks for confirming. Yep, I’m just routing the traffic through the public proxy for now. Hopefully it wont count towards egress when my fly.io executing services reaches out for the public proxy
Ok thanks. I was able to add the private IP and the dns lookup now succeeds.
I am also able to open a tcp connection to that private IP (on any port)…
but, the connection doesn’t get passed on to the target service… Not quite sure what I’m doing wrong here.
.internal works:
root@......:/flycd# nc -v <app-name>.internal 3000
Connection to <app-name>.internal (fdaa:......:4326:2) 3000 port [tcp/*] succeeded!
hej
HTTP/1.1 400 Bad Request
Connection: close
But .flycast doesn’t seem to forward the tcp connection
root@......:/flycd# nc -v <app-name>.flycast 3000
Connection to <app-name>.flycast (....:1::2) 3000 port [tcp/*] succeeded!
hej
The IP found by <app-name>.flycast dns lookup above matches that one created in fly ips list
~> fly ips list -a <app-name>
VERSION IP TYPE REGION CREATED AT
v6 ...........::69:35df public global 2023-07-02T18:38:08Z
private_v6 ............:0:1::2 private global 10m53s ago
v4 ............12 public (shared)
The target service has a single services section (not publicly exposed)