Files
truecharts/docs/manual/Quick-Start Guides/14-linking-apps.md
T
Stavros KoisandGitHub ab3f94e885 Update linking apps docs (#769)
* Update linking apps doc

* Formatting, rewording $NAMES

* fix label divs
2021-08-16 14:04:57 +02:00

3.9 KiB

14 - Linking Apps Internally

We often need to connect individual apps together, for example: Sonarr and SABnzbd. This means we first need to know how to reach those Apps.

Linking Apps Internally

The backend for TrueNAS SCALE Apps is Kubernetes. Linking apps together in Kubernetes is done slightly differently than in other systems, as you can't point directly to other containers using their IP address.

Instead we need to use their internal(!) domain name. Please beware: this name is only available between Apps and can not be reached from the host/node or your own PC.

The format for internal domain name for the main service is explained bellow. Please replace $NAME with the name you gave your App when installing and $APPNAME with the name the app has on the catalog where is needed.

If your app has the same name as in the catalog, the format is as follows.

  • $NAME.ix-$NAME.svc.cluster.local

If your app has different name than in the catalog, the format is as follows

  • $NAME-$APPNAME.ix-$NAME.svc.cluster.local

Kubernetes can usually identify the app when omitting svc.cluster.local as well:

  • $NAME.ix-$NAME or
  • $NAME-$APPNAME.ix-$NAME

If you need to reach a different service (which is not often the case!), you need a slightly different format, where $SVCNAME is the name of the service you want to reach:

If your app has the same name as in the catalog, the format is as follows.

  • $NAME-$SVCNAME.ix-$NAME.svc.cluster.local or
  • $NAME-$SVCNAME.ix-$NAME

If your app has different name than in the catalog, the format is as follows

  • $NAME-$APPNAME-$SVCNAME.ix-$NAME.svc.cluster.local or
  • $NAME-$APPNAME-$SVCNAME.ix-$NAME
Internal Domain Name generator

Generate Internal DNS Name:
<SCRIPT LANGUAGE="JavaScript"> const form = document.getElementById('frameform'); const name = document.getElementById('name'); const app = document.getElementById('app'); const service = document.getElementById('service'); form.onsubmit = submit; function submit(event) { var svcname = "" if (name.value == app.value) { svcname = name.value ; } else { svcname = name.value + "-" + app.value ; } if (service.value) { svcname = svcname + "-" + service.value ; } let svcdns = svcname + "." + "ix-" + name.value + ".svc.cluster.local" ; alert ("Service DNS Name: " + svcdns); console.log(svcdns) return false; } </SCRIPT>
Example

To reach an app named "sabnzbd" (same name as the catalog app name) within Sonarr, we can use the following internal domain name:

  • sabnzbd.ix-sabnzbd.svc.cluster.local or
  • sabnzbd.ix-sabnzbd

Video Guide

type:video

Additional Documentation

For more help troubleshooting DNS resolution in Kubernetes, review the official documentation: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/