Tricks to set a Custom App Hostname

marshalleq

Explorer
Joined
Mar 12, 2016
Messages
88
Hi all, I have more than one situation where the hostname being set to the pod name is completely breaking the app so that it won't function, or won't stay functioning.

Looking up kubernetes wiki, it is possible to set. But I assume that the TrueNAS architecture is preventing this. Does anyone know of any tricks to do it? Like for example a script that runs when the container starts or something?

Two examples I can start with straight away:

Roon - The clients of this app detect the host via broadcast and acquire the hostname as an identifier to connect to at first setup. That then applies the licence to that host. When the container is restarted, the hostname changes because the pod name changes. Then the client can't find the host, I have to reconnect, then remove the license from the former host, reapply it to the second host, then reconfigure the client settings again. Not nice at all. In addition, the client sees the host as a horrible unmeaningful name which could ultimately be called a security issue in that a user doesn't really know what you're connecting to is legit or not.

Another example is Machinaris. Machinaris a great Chia client, that handles more than just farming, including alerting, plotting, having a nice gui and a bunch of other nice features. The worker in it is assigned a hostname which is from the pod again. This breaks the app because it ends up with two workers, and the one it is connected to changes upon every container restart. Actually it doesn't work at all, because it seems to detect two workers and prioritises the one that isn't current.

I'm pretty sure Plex is another example as I have been unable to get this to work at all so far (custom app not official and not truecharts). The official Plex app has a bug in it that it doesn't work with a plex supported GPU (P2000) and IX Systems don't know how to fix it. I would bet that a lot of apps in the custom app arena are impacted by this problem. Unfortunately having a fixed IP does not resolve these issues.

I really hope that IX Systems take stock of that requested feature survey they did where proper docker support was at the top of the list. Having only kubernetes is really holding a lot of goodness back.

It is clear I must run a VM which is pretty frustrating considering how simple of a fix it should be to expose a hostname.

Thanks!

Marshalleq
 

evilpanda

Cadet
Joined
Jan 11, 2023
Messages
1
I was just struggling to figure this out as well.

Might depend on how you are deploying the containers (whether through Truenas or Truecharts etc) but I found that using host networking mode was the only way to get a persistent hostname for containers/pods.

This will obviously pull in the hostname of your Truenas instance though so isn't customisable per container.
 

marshalleq

Explorer
Joined
Mar 12, 2016
Messages
88
Hmmm, I didn’t think that worked for custom docker but perhaps it does if I don’t use fixed IP address, I don’t mind at all using the Truenas hostname - just want it to work.
 
Top