View Source Bonny.Controller behaviour (bonny v1.4.0)
Bonny.Controller
defines controller behaviours and generates boilerplate for generating Kubernetes manifests.
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.
Controllers allow for simple add
, modify
, delete
, and reconcile
handling of custom resources in the Kubernetes API.
Summary
Callbacks
Bonny.Controller comes with a default implementation which returns Bonny.Config.config()
Should return an operation to list resources for watching and reconciliation.
Callbacks
@callback add(map()) :: :ok | :error
@callback conn() :: K8s.Conn.t()
Bonny.Controller comes with a default implementation which returns Bonny.Config.config()
@callback delete(map()) :: :ok | :error
@callback list_operation() :: K8s.Operation.t()
Should return an operation to list resources for watching and reconciliation.
Bonny.Controller comes with a default implementation
@callback modify(map()) :: :ok | :error
@callback reconcile(map()) :: :ok | :error