Architecture
Chrysopoeia turns a Helm chart into a kind users can order, records every change to an ordered instance, and deploys the approved state with Flux.
It is one controller manager, chrysopoeia controller, plus an optional API proxy, chrysopoeia proxy, for harnessed operators.
From chart to CRD
The ClaimDefinitionManager reconciles ClaimDefinitions in the controller’s own namespace only.
-
It loads the chart from the Flux
OCIRepositoryinspec.reference. -
It generates a CRD from the chart’s
values.yaml, see values.yaml hints. The API group is the ClaimDefinition’s name plus.helmetica-bundles.io, the version isbundle, and kind and plural come fromspec.crdNames. -
It pins the versions a claim may pick, the
spec.versionenum, to the tags the FluxImageRepositoryinspec.versionDiscoverydiscovered, newest first.
The generated CRDs carry the label chrysopoeia.io/managed.
Deleting a ClaimDefinition leaves its CRD in place, so existing instances keep working.
Per claim
The DynamicReconcilerManager watches the generated CRDs and starts the following reconcilers for each of them, and stops them when the CRD is deleted.
| Reconciler | What it does |
|---|---|
|
Creates a |
|
Approves new revisions of claims with |
|
Creates the instance namespace |
The instance namespace carries the label chrysopoeia.io/instance and the annotations chrysopoeia.io/claim-apiVersion, -kind, -namespace, -name and -uid, which the other operators read to find the claim an instance belongs to.
The DynamicCRDsRBACAggregatorManager keeps an aggregated ClusterRole in step with the generated CRDs, so other operators can be granted access to claims of every kind without naming them.
Operators as services
A reagent can install an operator that manages resources for other instances. Three reconcilers keep such setups apart:
-
The
DependencyGroupManagervalidatesDependencyGroups: a CRD may belong to one group only, so two operators never manage the same resources. -
The
DependencyRBACManagerandDependencyNetworkPolicyManagergive operator namespaces access to the namespaces that require them. -
The
OperatorHarnessManagerregisters a mutating webhook perOperatorHarnessthat points the operator’s pods at the harness proxy instead of the Kubernetes API server, and copies the proxy’s CA certificate into the operator’s namespace. The proxy,chrysopoeia proxy, scopes what the operator sees to the label of its group.