Architecture
The adept is one controller manager with three reconcilers and one webhook. All of them write with server-side apply and own what they create, so deleting the parent removes it.
| Reconciler | Watches | Creates and owns |
|---|---|---|
|
|
One |
|
|
One |
|
|
Nothing; it writes |
|
|
Nothing; it rejects unusable windows and a second default window |
Running an action
-
The
ActionManagerresolves the instance namespace. In an instance namespace the Action runs in place. In a claim namespace it reads the claim named byspec.claim,spec.apiVersionandspec.kind, and takes itsstatus.instanceNamespace. Until that resolves, the reason is instatus.messageand the reconciler retries with backoff. -
It reads the
Definitionnamed byspec.typein the instance namespace. A missing Definition is final: the Action goes toFailed. -
It creates the Job
<action>-<type>there and moves the Action toPending. The Job is owned by the Action only when both live in the same namespace, since Kubernetes rejects owner references across namespaces. -
It maps the Job’s status onto the Action:
Running, thenSucceededorFailed. Both are final, an Action never runs twice.
A finalizer deletes the Job when the Action is deleted, including one in another namespace.
Maintenance
The MaintenanceManager resolves the window a Maintenance names, or the default window when it names none, and the ritual’s Definition.
It writes the CronJob in the instance namespace and reports the schedule it settled on in status.schedule.
Instances sharing a window are spread across it by a hash of the Maintenance’s namespace/name.
See Maintenance per instance and Maintenance windows.
A missing window is retried, because a chart may render the Maintenance before the window exists. A missing ritual is not an error: the schedule is still published and only the CronJob is removed.
Version bumps
The VersionManager moves a managed instance onto the newest version its claim allows, 15 minutes ahead of its maintenance, so the ritual runs against the version it is meant to.
It writes the version to the claim’s status.version; chrysopoeia then rolls the instance out.
-
It keys off the
Maintenance, which ties an instance namespace to a window. The namespace’s chrysopoeia annotations name the claim. -
The newest version is the first entry of the
spec.versionenum in the claim’s CRD, as chrysopoeia generates it. -
A claim with
spec.versionset is pinned and left alone. -
The annotation
adept.helmetica.io/bump-nowon the Maintenance asks for a bump straight away. Any new value triggers one; the same value again does nothing.
The adept has no rule for writing claims of its own. Claims are generated kinds, so the permission comes from the aggregated ClusterRole chrysopoeia keeps in step with the CRDs it generates.