Architecture
Custos is one reconciler, the CredentialConfigManager, plus a gather command, custos gather, that runs as a Job in the instance namespace.
One pass
Each reconcile of a CredentialConfig runs the whole flow and writes the outcome to its status:
-
Suspend. With
spec.suspendset, nothing else runs, and a Secret written earlier stays in place. -
Context. Custos reads the namespace’s chrysopoeia annotations to find the claim the instance belongs to. Without them, the instance is a plain helm install and the Secret lands in the instance namespace.
-
Validate. The value mapping is checked; a mapping that cannot work goes
Failedand never starts a Job. -
Gather. Only for
objectRefandexecsources, see below. -
Resolve.
constandclaimParamvalues are read directly, thentemplatevalues are rendered from the others, see Templating. -
Write. Custos applies the target Secret and records its name in
status.secretName, see Where the Secret lands. -
Clean up. A settled gather Job is deleted.
Most failures are a phase, not an error: a retry cannot fix a mapping that does not render or a target name that is taken, so they are reported as Failed instead of backing off forever.
Why a gather Job
Custos itself may read and write Secrets, ConfigMaps and Jobs, but not arbitrary kinds and not pods/exec.
objectRef and exec sources need exactly that, inside one instance namespace.
So custos writes a plan, the list of what to read, into a ConfigMap and starts a Job in the instance namespace that runs custos gather as instance-admin, the ServiceAccount chrysopoeia creates there.
The Job writes the gathered values into a Secret and its outcome into a ConfigMap, which custos reads back.
That keeps every cluster-wide grant out of custos, and the permissions of the Job end at the instance namespace. When a gather runs and how it retries is described in When a gather runs.
Owned resources
| Resource | Where and why |
|---|---|
Target |
Beside the claim, or in the instance namespace without one. Cross-namespace, so a finalizer on the CredentialConfig removes it instead of an owner reference. |
Plan |
In the instance namespace, owned by the CredentialConfig. Only created for |