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

  1. Runs tailscale status --json
  2. Extracts online peers from the response
  3. Filters by tag if tag_filter is set
  4. Constructs BEAM node names as <node_basename>@<tailscale_ip> (or <node_basename>@<dns_name> when use_dns_names: true)
  5. Connects/disconnects via libcluster's Cluster.Strategy API

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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(args)