InferenceObjective and InferenceModelRewrite

InferenceObjective and InferenceModelRewrite are optional upstream Gateway API Inference Extension (GAIE) Custom Resource Definitions (CRDs) in the inference.networking.x-k8s.io/v1alpha2 API group. These CRDs are not required for core Endpoint Picker (EPP) data paths or basic endpoint selection.

Use these resources to configure the following capabilities:

  • InferenceObjective: Attach service objectives (such as priority or criticality) to an InferencePool to differentiate incoming requests by importance.

  • InferenceModelRewrite: Rewrite the target model name on incoming requests before they reach the backend—enabling request routing to alias names or traffic splitting across model versions.

Both resources attach to an existing InferencePool using the spec.poolRef field and do not require duplicate configuration on the F5 side.

For complete CRD schemas, field descriptions, and example Custom Resources (CRs), see the Upstream GAIE Documentation.

Prerequisites

[WARNING] These CRDs are not included in the default BNK bundle. You must install them into your cluster before creating InferenceObjective or InferenceModelRewrite resources. Attempting to apply a resource without its CRD returns a no matches for kind error from the Kubernetes API server.

To ensure compatibility with this BNK release:

  1. Install the CRDs from GAIE release v1.4.0. Using CRDs from a different release version may introduce unrecognized schema fields or condition types.

  2. Confirm that the CRDs are registered in the cluster:

kubectl get crd inferenceobjectives.inference.networking.x-k8s.io
kubectl get crd inferencemodelrewrites.inference.networking.x-k8s.io
  1. Ensure all InferenceObjective and InferenceModelRewrite resources are created in the same namespace as their target InferencePool.

BNK Controller Validation Logic

The BNK controller does not modify these resources or create subordinate Kubernetes objects. Instead, it validates the spec configurations and writes the status back to each CR:

Custom Resource

Validation Behavior

InferenceObjective

Verifies that spec.poolRef contains a supported group/kind and that the referenced InferencePool exists in the target namespace.

InferenceModelRewrite

Performs the same spec.poolRef checks as InferenceObjective, plus per-rule structural validation (for example, ensuring rules do not mix weighted and non-weighted target models).

Upon validation, the controller writes an Accepted condition to the resource status.


Resource Status Reference

InferenceObjective Status Conditions

The Accepted condition status reflects the validation outcome:

Status

Reason

Description

True

Accepted

The resource is valid and successfully bound to an InferencePool in the same namespace.

False

PoolNotFound

The spec.poolRef.name value does not match any InferencePool in the resource namespace.

False

InvalidPoolRef

The specified spec.poolRef.group or spec.poolRef.kind is unsupported.

To check the resource status:

kubectl get inferenceobjective <objective-name> \
  -n <pool-namespace> \
  -o jsonpath='{.status.conditions}' | jq -c '.[] | {type, status, reason}'

InferenceModelRewrite Status Conditions

The Accepted condition status reflects the validation outcome:

Status

Reason

Description

True

Accepted

The resource is valid, spec.poolRef resolves, and all rules pass validation.

False

PoolNotFound

The spec.poolRef.name value does not match any InferencePool in the resource namespace.

False

InvalidPoolRef

The specified spec.poolRef.group or spec.poolRef.kind is unsupported.

False

InvalidRules

At least one rule failed validation (for example, mixed weighted/non-weighted target models or an unsupported match type).

To check the resource status:

kubectl get inferencemodelrewrite <rewrite-name> \
  -n <pool-namespace> \
  -o jsonpath='{.status.conditions}' | jq -c '.[] | {type, status, reason}'

Troubleshooting

Symptom

Cause

Resolution

no matches for kind error on resource apply

The required upstream CRD is not installed in the cluster.

Install the GAIE release v1.4.0 CRDs, then re-apply your resource manifest.

Accepted=False, reason: PoolNotFound

The referenced InferencePool does not exist in the current namespace.

Verify the pool name and namespace using kubectl get inferencepool -n <pool-namespace>.

Accepted=False, reason: InvalidPoolRef

An unsupported group or kind override is set in spec.poolRef.

Ensure spec.poolRef.group is set to inference.networking.k8s.io and spec.poolRef.kind is set to InferencePool. Remove invalid overrides and re-apply.

Accepted=False, reason: InvalidRules

One or more rewrite rules failed validation.

Check the status condition message for details, correct the failing rule in spec.rules[], and re-apply. Note: Partial rule applications are not supported; the entire resource must pass validation.