Reconciliation
This page explains the current controller flow. The behavior contract remains in the spec.
Current Flow
For each InferenceIdentityBinding, the reconciler currently does the following:
- Fetch the binding and ensure the
kleym.sonda.red/inferenceidentitybinding-finalizeris present. - Resolve the referenced
InferenceObjectivefromspec.targetRef.name. - Extract
spec.poolReffrom that objective and reject cross-namespace references. - Resolve the referenced
InferencePool. - Derive pod-label selectors from
pool.spec.selector. - Render workload selector templates from the binding and merge them with the pool-derived selectors.
- Add the container discriminator selector when the effective mode is
PerObjective. - Validate selector safety before rendering or writing output.
- Render the SPIFFE ID, using either the custom template or the built-in default for the mode.
- Run per-objective collision detection.
- Create, update, or delete managed
ClusterSPIFFEIDresources to match the rendered identity. - Patch binding status and emit events for success, conflict, or failure.
Requeue Sources
The controller does not only react to the binding itself. It also watches:
InferenceObjective, so changes topoolRefor object existence requeue affected bindingsInferencePool, so selector changes requeue bindings whose objectives reference that pool
That keeps the rendered identity tied to current objective and pool state instead of only the binding object.
Failure Shape
The reconciler treats invalid references, unsafe selectors, render failures, and collisions as controller state, not as crashes. In those paths it updates status, emits an event, and removes stale managed output instead of leaving outdated ClusterSPIFFEID resources behind.