Skip to content

About

A control-loop library for things that are not in k8s

Resources

Contributing

Stars

52 stars

Watchers

8 watching

Forks

Repository files navigation

kreconciler

Go Report Card Go Reference Release

A library to build control-loops for things other than Kubernetes.

Principle

Kubernetes operators are amazing for building reliable operational tooling.

Unfortunately as its name points out it is specific to Kubernetes. This library brings a simple way to build reconcilers which is the core of an operator. It runs a loop that for each event coming in will trigger the control-loop.

Its core goals are:

  1. Remain simple, caching, resync are not meant to be builtins because they are hard to be generic.
  2. Observability is important so it's instrumented with opentelemetry.
  3. Keep the number of dependencies low.

The reason why 2 is so important is that testing an operator is incredibly complicated. It's therefore necessary to make execution of the reconciler as observable as possible to be able to figure out issues.

Concurrency

Items wait in a FIFO queue, and any free worker takes the oldest one. Config.Router gives each item a key (its id by default): two items with the same key never run at once, and an item whose key is busy waits without holding a worker. Use a parent id as the key to serialize the items of a parent. Config.Queues reserves workers for named queues, so that one kind of item never waits behind another.

Who uses it

At Koyeb we've built reconcilers that helps keeping our models in sync with Hashicorp Nomad and Kuma.

Contributing

See Contributing.

About

A control-loop library for things that are not in k8s

Resources

Contributing

Stars

52 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages