View Source Libcluster Droplet Strategy

Test Status Hex Version

A Digital Ocean Droplet clustering strategy for libcluster. This strategy will connect all Droplets in your account to the cluster and can optionally be filtered by Droplet name or tag. It works by polling the Digital Ocean API, so a valid access token is required.

getting-started

Getting Started

def deps do
  [
    {:libcluster_droplet, "~> 1.0"}
  ]
end
config :libcluster,
  topologies: [
    example: [
      strategy: Cluster.Strategy.Droplet,
      config: [
        token: System.fetch_env!("DIGITALOCEAN_TOKEN"),
        tag_name: "foobar"
      ]
    ]
  ]

config

Config

KeyRequiredDescription
:tokenThe Digital Ocean access token used for authenticating with the API.
:networkWhether to use private or public IP addresses in the node name. Defaults to :public.
:ipv6Whether to use IPv6 addresses in the node name. Defaults to false.
:tag_nameDroplet tag to filter by when adding to the cluster. Cannot be combined with :name.
:nameDroplet name to filter by when adding to the cluster. Cannot be combined with :tag_name.
:node_basenameThe base name of the nodes you want to connect to. Defaults to the Droplet name.
:polling_intervalNumber of milliseconds between polls to the API. Defaults to 5_000.