Raxol.Swarm.Strategy.Tailscale
(Raxol v2.3.0)
View Source
libcluster strategy that discovers BEAM nodes via Tailscale.
Polls tailscale status --json to find online peers, optionally
filters by Tailscale tags, and connects them as BEAM nodes.
Options
node_basename- Short name for BEAM nodes (required; e.g. "raxol")poll_interval- How often to poll in milliseconds (default: 5_000)tag_filter- Only connect to peers with this tag (optional; e.g. "tag:raxol")use_dns_names- Use MagicDNS names instead of IPs (default: false)tailscale_cli- Path to tailscale binary (default: "tailscale")
Usage
config :libcluster,
topologies: [
tailscale: [
strategy: Raxol.Swarm.Strategy.Tailscale,
config: [
node_basename: "raxol",
tag_filter: "tag:raxol",
poll_interval: 5_000
]
]
]Or via Discovery preset:
Raxol.Swarm.Discovery.start_link(
strategy: :tailscale,
node_basename: "raxol",
tag_filter: "tag:raxol"
)How it works
- Runs
tailscale status --json - Extracts online peers from the response
- Filters by tag if
tag_filteris set - Constructs BEAM node names as
<node_basename>@<tailscale_ip>(or<node_basename>@<dns_name>whenuse_dns_names: true) - Connects/disconnects via libcluster's
Cluster.StrategyAPI
Requires tailscale CLI to be installed and the node to be logged
into a tailnet.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.