Bella: Kubernetes Controller Framework

Bella make it easy to create Kubernetes Controllers.

Installation

Bella can be installed by adding bella to your list of dependencies in mix.exs:

def deps do
  [
    {:bella, "~> 0.0.1"}
  ]
end

Configuration

Bella uses the k8s client under the hood.

config :k8s,
  clusters: %{
    default: %{ # `default` here must match `cluster_name` below
      conn: "~/.kube/config"
    }
  }

  # K8s.Cluster to use, defaults to :default
  cluster_name: :default

Telemetry

Bella uses the telemetry and notion library to emit event metrics.

Events: Bella.Sys.Event.events()

[
  [:bella, :reconciler, :genserver, :down],
  [:bella, :reconciler, :reconcile, :failed],
  [:bella, :reconciler, :reconcile, :succeeded],
  [:bella, :reconciler, :run, :started],
  [:bella, :reconciler, :fetch, :failed],
  [:bella, :reconciler, :fetch, :succeeded],
  [:bella, :reconciler, :initialized],
  [:bella, :watcher, :genserver, :down],
  [:bella, :watcher, :chunk, :received],
  [:bella, :watcher, :watch, :timedout],
  [:bella, :watcher, :watch, :failed],
  [:bella, :watcher, :watch, :finished],
  [:bella, :watcher, :watch, :succeeded],
  [:bella, :watcher, :watch, :started],
  [:bella, :watcher, :initialized]
]

Terminology

Controller:

A custom controller is a controller that users can deploy and update on a running cluster, independently of the cluster’s own lifecycle. Custom controllers can work with any kind of resource, but they are especially effective when combined with custom resources. The Operator pattern is one example of such a combination. It allows developers to encode domain knowledge for specific applications into an extension of the Kubernetes API.

Testing

mix test