libelection v0.2.0 Election.Strategy.Kubernetes

This leader election strategy leverages the Kubernetes API

API Docs: https://kubernetes.io/docs/concepts/overview/kubernetes-api/

The connected node with the least resourceVersion is elected as leader.

Options

  • kubernetes_node_basename: The shared name of the Kubernetes nodes. For a example@127.0.0.1, it would be example
  • kubernetes_selector: The label selector (see: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to apply for node discovery

Link to this section Summary

Functions

Returns the leader node of the cluster

Link to this section Functions

Link to this function leader(connected_nodes, config)
leader([node()], %{}) :: %{node: node(), metadata: map()} | nil

Returns the leader node of the cluster

Link to this function log(level, tag, fun)