Cluster.Strategy.Netbird (libcluster_mesh v0.1.0)

Copy Markdown View Source

libcluster strategy that discovers peers by polling the local NetBird daemon via netbird status --json.

Works with NetBird cloud and self-hosted management alike — peer information comes from the node's own daemon, so no management API token is needed.

Usage

Every node must be a connected NetBird peer (see the README's Prerequisites). Start each node with a longname built from its NetBird IPv4 (e.g. myapp@100.94.0.5), then configure:

config :libcluster,
  topologies: [
    netbird: [
      strategy: Cluster.Strategy.Netbird,
      config: [
        node_basename: "myapp",
        hostnames: ["myapp-"]
      ]
    ]
  ]

Options

  • node_basename (required) — node name part before @, shared by all nodes
  • hostnames (required) — list of NetBird hostname prefixes (matched against the first label of each peer's FQDN) that identify cluster members
  • cli — path to the netbird binary (default "netbird")
  • polling_interval — poll interval in milliseconds (default 5_000)
  • cmd_timeout — CLI timeout in milliseconds (default 10_000)
  • runnerLibclusterMesh.Runner implementation (default runs the CLI)