Fix Kubernetes node naming for distributed Erlang clustering
This commit is contained in:
parent
14ffefe2e9
commit
187a607563
2 changed files with 11 additions and 2 deletions
|
|
@ -147,7 +147,7 @@ if config_env() == :prod do
|
|||
strategy: Cluster.Strategy.Kubernetes.DNS,
|
||||
config: [
|
||||
service: "aprs-headless",
|
||||
application_name: "aprs",
|
||||
application_name: "aprsme",
|
||||
namespace: System.get_env("POD_NAMESPACE", "aprs"),
|
||||
polling_interval: 10_000
|
||||
]
|
||||
|
|
|
|||
|
|
@ -17,7 +17,16 @@
|
|||
# Set the release to work across nodes.
|
||||
# RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
|
||||
export RELEASE_DISTRIBUTION=name
|
||||
export RELEASE_NODE=<%= @release.name %>@${DOKKU_APP_NAME:-aprsme}.web.${DOKKU_APP_INSTANCE:-1}
|
||||
|
||||
# Check if we're in Kubernetes (POD_NAME will be set)
|
||||
if [ -n "$POD_NAME" ]; then
|
||||
# Use Kubernetes pod name and headless service for clustering
|
||||
export RELEASE_NODE=${RELEASE_NODE:-<%= @release.name %>@${POD_NAME}.aprs-headless.aprs.svc.cluster.local}
|
||||
else
|
||||
# Fallback to Dokku naming for non-Kubernetes deployments
|
||||
export RELEASE_NODE=<%= @release.name %>@${DOKKU_APP_NAME:-aprsme}.web.${DOKKU_APP_INSTANCE:-1}
|
||||
fi
|
||||
|
||||
export RELEASE_COOKIE=${RELEASE_COOKIE:-Euta32aoLfgADYz3TiSCpQP0Y3iD7AD3zu0ycYWI5lQ=}
|
||||
|
||||
#ip=$(grep fly-local-6pn /etc/hosts | cut -f 1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue