Operator Spec
kleym-operator is an identity registration compiler. It translates inference intent into deterministic Secure Production Identity Framework for Everyone (SPIFFE) identities and writes SPIFFE Runtime Environment (SPIRE) Controller Manager ClusterSPIFFEID resources.
Kleym stops at identity registration. It does not deploy inference workloads, route traffic, configure gateways, evaluate request policy, issue credentials, or write SPIRE registration entries directly.
Scope
Kleym owns InferenceIdentityBinding, GAIE input resolution, SPIFFE ID rendering, selector safety, managed ClusterSPIFFEID reconciliation, status, events, and finalizer cleanup.
Kleym does not own inference workloads, schedulers, routes, gateways, serving behavior, Envoy, OPA, OAuth, OIDC, SPIRE Server, SPIRE Agent, credential issuance, authorization, or audit decisions.
Dependency facts live in Dependencies. Supported GAIE inputs live in GAIE Compatibility.
Operator Configuration
kleym-operator requires install-level identity configuration at startup:
| Flag | Required | Behavior |
|---|---|---|
--trust-domain=<value> | yes | Sets the SPIRE Server trust domain used when rendering every SPIFFE ID. The value must not include spiffe://, must not contain /, and must not include leading or trailing whitespace. |
--clusterspiffeid-class-name=<value> | no | Sets spec.className on every managed ClusterSPIFFEID. When empty, Kleym omits spec.className and keeps classless output. |
trustDomain and ClusterSPIFFEID class are deployment concerns, not per-binding inference identity intent. They are not fields on InferenceIdentityBinding.
When --clusterspiffeid-class-name is empty, SPIRE Controller Manager must be configured to watch classless ClusterSPIFFEID resources, for example with its watchClassless behavior. When a class name is set, SPIRE Controller Manager must watch that class.
API Contract
InferenceIdentityBinding is namespaced. Pool and objective references stay in that namespace.
poolRefreferences oneInferencePool. The pool is the required workload anchor and selector provenance source.objectiveRefreferences oneInferenceObjective. It is required forPerObjective; the objective must reference the same pool aspoolRef.modeisPoolOnlyorPerObjective. These are the only identity boundaries. The default isPerObjective.serviceAccountNameis required. Kleym renders safety selectors internally ask8s:ns:<binding namespace>andk8s:sa:<serviceAccountName>.- SPIFFE IDs are always deterministic under the configured trust domain:
PoolOnly:spiffe://<trustDomain>/ns/<namespace>/pool/<pool-name>PerObjective:spiffe://<trustDomain>/ns/<namespace>/objective/<objective-name>
containerNameis required forPerObjectiveand must be empty forPoolOnly.- Status records
computedSpiffeIDs,renderedSelectors, and conditions. Conditions includeReady,Conflict,InvalidRef,UnsafeSelector, andRenderFailure.
Field details live in API Reference. Condition details live in Conditions Reference.
Required Behavior
- Discover supported GAIE pool and objective GVKs served by the cluster and watch only that subset.
- Fail startup when no supported
InferencePoolGVK is available. Objective GVKs are optional forPoolOnly. - Resolve
poolRefandobjectiveRefonly to documented supported GAIE groups. - Derive pod selection from the referenced pool, then combine it with internal namespace and service-account safety selectors and, in
PerObjectivemode,k8s:container-name:<containerName>. - Refuse unsafe selectors. If the selector set cannot be proven to stay within the binding namespace and required service account boundary, set
UnsafeSelectorand produce no managed output. - Render the SPIFFE ID and managed
ClusterSPIFFEIDshape deterministically. Rendered output fields are documented in Managed Resources. - Refuse identity collisions. If two
PerObjectivebindings would match the same pod set and same container-name value, setConflict=Truewith reasonIdentityCollisionon both resources and reconcile neither until fixed. - Treat missing required CRDs and infrastructure-not-ready states as transient by retrying reconciliation on a timer.
- On deletion, delete managed
ClusterSPIFFEIDchildren first and keep the binding finalizer until a follow-up list confirms no managed children remain.
Collision behavior is expanded in Collision Detection. Selector rationale is expanded in Selector Safety.
Safety Invariants
InferenceIdentityBindingis namespaced.- Pool and objective references stay in the binding namespace.
PoolOnlyandPerObjectiveare the only identity boundaries.- Unsafe selectors are refused.
- Identity collisions are refused with
ConflictreasonIdentityCollision. - Deletion keeps the finalizer until managed children are gone.
kleym-operatordoes not create or modify inference deployments, pools, routes, gateways, schedulers, or policy resources.