From 93397badbd6a842963104a196c747cd644fd63d0 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 25 Jul 2025 12:35:27 -0500 Subject: [PATCH] Switch to Kubernetes strategy with hostname mode for StatefulSet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on libcluster documentation, StatefulSets should use the standard Kubernetes strategy with mode: :hostname, not the DNS strategy. This properly discovers pods using their stable hostnames and filters out the current node from connection attempts. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- config/runtime.exs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/config/runtime.exs b/config/runtime.exs index 519c7f6..f930560 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -141,15 +141,16 @@ if config_env() == :prod do # Configure libcluster topology based on environment if cluster_enabled do - # Use Kubernetes DNS strategy for StatefulSet + # Use Kubernetes strategy with hostname mode for StatefulSet config :libcluster, topologies: [ k8s: [ - strategy: Cluster.Strategy.Kubernetes.DNS, + strategy: Cluster.Strategy.Kubernetes, config: [ - service: "aprs-headless", - application_name: "aprsme", - namespace: "aprs", + mode: :hostname, + kubernetes_node_basename: "aprsme", + kubernetes_selector: "app=aprs", + kubernetes_namespace: "aprs", polling_interval: 5_000 ] ]