libcluster v3.0.3 Cluster.Strategy.Kubernetes.DNS
This clustering strategy works by loading all your Erlang nodes (within Pods) in the current Kubernetes namespace. It will fetch the addresses of all pods under a shared headless service and attempt to connect. It will continually monitor and update its connections every 5s.
It assumes that all Erlang nodes were launched under a base name, are using longnames, and are unique
based on their FQDN, rather than the base hostname. In other words, in the following
longname, <basename>@<ip>
, basename
would be the value configured through
application_name
.
An example configuration is below:
config :libcluster,
topologies: [
k8s_example: [
strategy: Elixir.Cluster.Strategy.Kubernetes.DNS,
config: [
service: "myapp-headless",
application_name: "myapp",
polling_interval: 10_000]]]
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
Callback implementation for Cluster.Strategy.start_link/1
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Callback implementation for Cluster.Strategy.start_link/1
.