From 777acc2700304992bb31ee7a75ea61c9a0dec295 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 25 Jul 2025 12:37:37 -0500 Subject: [PATCH] Use DNSSRV strategy for StatefulSet clustering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch to Kubernetes.DNSSRV strategy which is specifically designed for StatefulSets and uses DNS SRV records for node discovery. This strategy: - Doesn't require Kubernetes API permissions (no RBAC needed) - Automatically filters out the current node - Works with StatefulSet stable DNS names - Uses SRV records from the headless service 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- config/runtime.exs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/config/runtime.exs b/config/runtime.exs index f930560..d826ffd 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -141,16 +141,15 @@ if config_env() == :prod do # Configure libcluster topology based on environment if cluster_enabled do - # Use Kubernetes strategy with hostname mode for StatefulSet + # Use DNSSRV strategy for StatefulSet clustering config :libcluster, topologies: [ k8s: [ - strategy: Cluster.Strategy.Kubernetes, + strategy: Cluster.Strategy.Kubernetes.DNSSRV, config: [ - mode: :hostname, - kubernetes_node_basename: "aprsme", - kubernetes_selector: "app=aprs", - kubernetes_namespace: "aprs", + service: "aprs-headless", + application_name: "aprsme", + namespace: "aprs", polling_interval: 5_000 ] ]