Documentation
¶
Overview ¶
domain/generic.go
domain/health.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnyReconcileHooks ¶
type AnyReconcileHooks interface {
// contains filtered or unexported methods
}
AnyReconcileHooks is the type-erased form of ReconcileHooks[T]. GenericReconciler holds the concrete typed version internally. This exists only so the Katalog can store hooks without knowing T.
type Health ¶
type Health interface {
// SetReady marks the component as initialised and ready to process work.
// Called once by the component after successful startup.
// Implies the component is also healthy.
SetReady()
// Degraded marks the component as alive but not ready to process work.
// Used when a recoverable error condition is detected — for example,
// when a CRD's consecutive failure threshold is exceeded.
// The component remains running but is removed from the ready pool.
// Distinct from Unhealthy: the process does not need to be restarted.
Degraded()
// Unhealthy marks the component as neither healthy nor ready.
// Called during shutdown or when an unrecoverable error is detected.
// A Kubernetes liveness probe failing on this state will trigger a restart.
Unhealthy()
// Healthy returns true if the component is in a healthy state.
// Maps to the Kubernetes liveness probe — false triggers a pod restart.
Healthy() bool
// Ready returns true if the component is initialised and ready to process work.
// Maps to the Kubernetes readiness probe — false removes the pod from service endpoints.
Ready() bool
// Started returns true if the component has been started at least once.
// Used by the manager to guard against double-start and to sequence
// post-start hooks correctly.
Started() bool
}
Health is the observability contract for any Orkestra Komponent that exposes liveness and readiness state.
Implementations are expected to be safe for concurrent use — all methods may be called from multiple goroutines simultaneously.
The distinction between healthy and ready follows the Kubernetes convention:
- Healthy (liveness) — the component is alive and not in a broken state. An unhealthy component should be restarted.
- Ready (readiness) — the component is initialised and able to serve traffic or process work. A non-ready component should not receive work yet but does not need to be restarted.
Typical lifecycle:
NewComponent() → healthy: false, ready: false Start() → healthy: true, ready: true (via SetReady + Healthy) Shutdown() → healthy: false, ready: false (via Unhealthy) Error condition → healthy: false, ready: true (via Degraded — still alive, not accepting work)
type ObjectList ¶
type ObjectList interface {
metav1.ListInterface
runtime.Object
}
type ReconcileHooks ¶
type ReconcileHooks[T Object] struct { // OnReconcile is called for every create/update event. // obj is already type-asserted and deep-copied. // Return an error to requeue with backoff. OnReconcile func(ctx context.Context, obj T) error // OnDelete is called when the object's DeletionTimestamp is set. // Use this to clean up external resources before the finalizer is removed. // If nil, deletion is a no-op (finalizer removed automatically). OnDelete func(ctx context.Context, obj T) error // OnNotFound is called when the object no longer exists in the store. // Use this for cleanup that depends on the key but not the object. // If nil, not-found is a no-op. OnNotFound func(ctx context.Context, key string) error }
ReconcileHooks contains the user-provided business logic. Only implement the hooks you need — all are optional.