Maestro πΌ
Maestro is an opinionated framework designed to streamline the orchestration of reconcilers within the Kubernetes
ecosystem. By adopting a clear and structured approach, Maestro simplifies the registration, execution, and management
of reconcilers, enabling developers to focus on the core logic of their applications without getting bogged down by the
intricacies of Kubernetes resource management. π
Features β¨
- π Simple and intuitive API for building reconcilers
- π Supports generic parent and child objects that implement
the
client.Object
interface
- ποΈ Provides a fluent builder pattern for constructing reconcilers with ease
- π― Offers customizable predicate functions to control reconciliation behavior
- π Supports optional owner references for child objects
- πββοΈ Enables dry-run mode for avoiding unnecessary requeues and optimizing performance
- π Allows customization of object comparison options to avoid unnecessary updates
- ποΈ Supports deletion of child objects based on custom conditions
- π§ Integrates with the Conductor package for
advanced status condition handling
Getting Started π
Prerequisites
Installation
To install Maestro, use the following command:
go get github.com/ethan-gallant/maestro
Usage
Here's a minimal example of how to use the Simple Reconciler package to reconcile a child object for a parent object:
package main
import (
"context"
"github.com/ethan-gallant/maestro/pkg/reconciler/simple"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func podReconcileFunc(ctx context.Context, deployment *appsv1.Deployment) (*corev1.Pod, error) {
return &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: deployment.Name + "-pod",
Namespace: deployment.Namespace,
Labels: deployment.Spec.Template.Labels,
},
Spec: deployment.Spec.Template.Spec,
}, nil
}
func newPodReconciler() *simple.Reconciler[*appsv1.Deployment, *corev1.Pod] {
return simple.FromReconcileFunc(podReconcileFunc).
WithDetails(api.Descriptor{
Name: "PodReconciler",
Description: "Reconciles Pod for Deployment",
}).
Build()
}
For more detailed examples and usage instructions, please refer to
the Simple Reconciler Package README.
Key Components π
Conductor π
The Conductor is a generic interface that facilitates the registration and coordination of reconcilers. It acts as the
central hub through which all reconcilers are managed. For more information, see
the Conductor Package README.
Reconciler π
The Reconciler is an interface defining the essential method Reconcile
, which encapsulates the logic for reconciling
the state of a Kubernetes resource. Maestro provides a Simple Reconciler implementation in
the Simple Reconciler Package.
Binder π
The Binder package provides a convenient way to bind and retrieve values from a context.Context
using static or
dynamic keys. It offers a type-safe and flexible approach to store and access custom data within a context. For more
information, see the Binder Package README.
Documentation π
For detailed documentation and examples, please refer to the individual package READMEs:
Contributing π€
We welcome contributions to Maestro! If you have any ideas, suggestions, or bug reports, please open an issue or submit
a pull request. For more information, see the Contributing Guide.
License π
Maestro is released under the MIT License.
Happy orchestrating with Maestro! π