Reconciliation
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
InferencePoolfromspec.poolRef. - Resolve
spec.objectiveRefwhen present or required byPerObjective. - Validate that any resolved objective points at the same pool as
spec.poolRef. - Derive pod-label selectors from
pool.spec.selector. - Render namespace and service-account safety selectors from the binding and merge them with the pool-derived selectors.
- Add the
containerNameselector when the effective mode isPerObjective. - Validate selector safety before rendering or writing output.
- Render the deterministic SPIFFE ID 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 to object existence orspec.poolRefrequeue only bindings whosespec.objectiveRef.namepoints at that objectiveInferencePool, so selector changes requeue only bindings whosespec.poolRef.namepoints at that pool
That keeps the rendered identity tied to current objective and pool state instead of only the binding object.
Watch predicates filter status-only update events to avoid hot loops. Create and delete events still enqueue, and update events enqueue when object generation changes or deletion state changes.
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.
For missing required external CRDs (InferencePool, ClusterSPIFFEID, or InferenceObjective when an objective subject is needed), the reconciler also schedules a timed retry (RequeueAfter) so recovery does not depend on unrelated future events.