A simple leader election sidecar container for Kubernetes based on the recent client-go library. It aims to provide an alternative to the widely used but outdated election
component of kubernetes/contrib.
The following arguments can be passed on the command line, or by setting the environment variable named in brackets.
election
- name of the election and the corresponding lock resource (ELECTION_NAME).namespace
- the Kubernetes namespace to run the election in (ELECTION_NAMESPACE).locktype
- the leaselock resource type to use for this deployment (ELECTION_TYPE). Supported lock types are:configmaps
- defaultleases
endpoints
port
- the port on which the election sidecar can be queried (ELECTION_PORT).
A working example deployment can be found under example/deployment.yaml
- Configurable lock type (LeaseLock, ConfigMap, Endpoint)
- Make configuration fail safe