Hi, I discovered incus recently and I really like it.
I’m testing the communicate between instances, but I can’t to communicate the microservices betwheen they
I testing 2 instances first (ub1, ub2).
in ub1 I have a server run in port 80, but from ub2 i don’t connected
(venv) root@ub1:~# uvicorn handler:app --port 80
INFO: Started server process [3404]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:80 (Press CTRL+C to quit)
from the ub2
root@ub2:~# curl ub1
curl: (6) Could not resolve host: ub1
root@ub2:~# curl 10.96.125.214
curl: (7) Failed to connect to 10.96.125.214 port 80 after 0 ms: Connection refused
root@ub2:~#
When you run a network service in an instance, this service may bind/listen to a specific interface only. Here it says that it listens only on loopback (127.0.0.1), meaning that this network service is not readily accessible from other instances.
You would need to get each network service to listen to the Incus private network (typically eth0).
Then, they will be accessible even using the build-in hostnames, like ub2.incus. Those hostnames are available to instances and they can address each other with those names.
The option should be host. You can specify it in the configuration file of Uvicorn, or in the command line.
If you set the host to 0.0.0.0, that is a special value, and it means that the service should bind/listen to all network interfaces, including your incusbr0 network interface.