Inter-app communication in 24.10 Electric Eel

Problem/Justification

In TrueNAS SCALE 24.04, it was possible for apps to communicate with each other via cluster.local domain names since they were all on the same network. For example, I use the Nginx Proxy Manager app to reverse proxy to another app on the same TrueNAS machine by using its internal domain name, such as http://immich.ix-immich.svc.cluster.local:30041.

In 24.10, this is no longer possible if using the default apps catalog since each app has its own Docker network that is not shared with other apps. Users may work around this by referencing the TrueNAS host’s IP or hostname in place of the previously-used *.cluster.local name, but this creates a dependency between the app and the host and requires the user to expose the necessary port on the host, which may not always be desirable. Another possible way is by using a custom docker-compose YAML file.

Impact

As it currently stands, apps that were once able to communicate with each other are no longer able to. In addition to the reverse proxy use case above, this type of functionality is useful for apps like Sonarr, Radarr, and Prowlarr which communicate with each other and with download clients. I imagine this is a very popular use case for TrueNAS users.

Allowing apps to easily communicate with each other will ease disruption created by the k8s → Docker migration for users upgrading to 24.10 (myself included).

User Story

I can see two possible implementations of this feature.

Implementation 1: All apps share a network

This is most similar to how it worked in 24.04. All apps could simply share a network and all users need to do is change usages of the *.cluster.local names to their Docker network counterpart. For example, immich.ix-immich.svc.cluster.local would become ix-immich-immich-1.

Implementation 2: User-defined networks

By default, apps will only be part of its own network (as the situation is right now). Users will be able to create their own network from the Apps UI or CLI and configure apps to be part of these networks.

This is a slightly more secure option since it facilitates the principle of least privilege, allowing users to dictate which apps can and can’t connect to one another. But it is also slightly more effort.


For a clean K8S → Docker migration, I think it makes sense to work on Implementation 1 as a first pass, then save Implementation 2 for a larger release.

1 Like

Thankful that someone else brought this up. I’ve been running into issues with NPM for this exact reason, as I have a second server running and would like to connect the docker services on both devices via an overlay network, but TrueNAS Scale is a little limiting in this regard.

1 Like

I’m kind of surprised nobody brought it up during the release candidate testing! :sweat_smile:

I would assume because container orchestration is primarily focused around Kubernetes as opposed to docker swarm, but I wish there was at least the freedom to choose. I will most likely have to either just use K8s or find some solution from the community. Oh well.

Plain Docker can do it. It’s just networking understanding and manipulation.

Learn about NAT, Docker networks, docker compose, network type host, network type macvlan.

Yes, it’s very simple to do this with normal unmanaged Docker or with a custom docker-compose YAML app (as I mentioned in the original post), but that requires breaking out of the TrueNAS-managed app catalog. I’d like to stick with the official catalog to keep my TrueNAS host low-maintenance and as appliance-like as possible. So this functionality should be available from the 24.10 Apps UI, especially since it was possible in 24.04 and is very commonly used.

1 Like

I just stumbled into this. Basically, all inter-app communication is now broken from official apps. This makes apps like NPM useless, since they can’t proxy to anything.

Why can’t you use the $HOSTIP:port ?

This requires exposing containers to the outside. Also, the ip might change.

  1. Not all ports are forwarded from container to host. For example, Redis in the app catalog does not forward port 6739 (the port for the actual Redis daemon), and there is no way to define that.
  2. It creates an unnecessary dependency on the host network — if the TrueNAS hostname or IP changes (depending on which is used), it will break communication between apps.
  3. It’s good security practice to not expose ports on the host unless it is necessary.
1 Like