Akka 2.4 in Kubernetes cluster

Seems I have an issue since the hostname must be 0.0.0.0 but the nodes need the internal names, aka

akka {
actor {
provider = “akka.cluster.ClusterActorRefProvider”
}
remote {
log-remote-lifecycle-events = on
netty.tcp {
hostname = “0.0.0.0”
port = 9002
}
}

cluster {
seed-nodes = [
# must use the application
“akka.tcp://application@diesel-0.diesel.netlinq.svc.cluster.local:9002”,
“akka.tcp://application@diesel-1.diesel.netlinq.svc.cluster.local:9002”]

min-nr-of-members = 1

}

akka.extensions = [“akka.cluster.pubsub.DistributedPubSub”]
}

The two nodes seem to have issues connecting and accepting messages:

2023-02-04 02:33:17,617 E [cher-68] EndpointWriter: dropping message [class akka.actor.ActorSelectionMessage] for non-local recipient [Acto
r[akka.tcp://application@diesel-1.diesel.netlinq.svc.cluster.local:9002/]] arriving at [akka.tcp://application@diesel-1.diesel.netlinq.svc.
cluster.local:9002] inbound addresses are [akka.tcp://application@0.0.0.0:9002]

And (from the -1 node)…

2023-02-04 02:34:19,613 W [cher-81] ReliableDeliverySupervisor: Association with remote system [akka.tcp://application@diesel-0.diesel.netlinq.svc.cluster.local:9002] has failed, address is now gated for [5000] ms. Reason: [Disassociated]

2023-02-04 02:34:19,642 W [cher-97] ReliableDeliverySupervisor: Association with remote system [akka.tcp://application@diesel-1.diesel.netlinq.svc.cluster.local:9002] has failed, address is now gated for [5000] ms. Reason: [Disassociated]

Any known solution for 2.4 ? thanks.

To answer myself, in 2.5 this works, using an undocumented attribute:

netty.tcp {
bind-hostname = “0.0.0.0”
hostname = ${HOST}
port = 9002
}

And you can make up HOST to be “diesel-0.diesel.netlinq.svc.cluster.local” for instance, before the process starts - pass it in or make it up.