Skip to content

fix(operator): tolerate missing KEDA when cleaning up ScaledObject (#981)#985

Open
Anai-Guo wants to merge 1 commit into
vllm-project:mainfrom
Anai-Guo:fix/vllmruntime-keda-not-installed
Open

fix(operator): tolerate missing KEDA when cleaning up ScaledObject (#981)#985
Anai-Guo wants to merge 1 commit into
vllm-project:mainfrom
Anai-Guo:fix/vllmruntime-keda-not-installed

Conversation

@Anai-Guo

@Anai-Guo Anai-Guo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #981.

The VLLMRuntime controller failed on every reconciliation on clusters without KEDA installed, even when no VLLMRuntime requested autoscaling — making the operator unusable there.

Root cause

In the autoscaling-disabled branch of Reconcile, the controller best-effort deletes a possibly-stale keda.sh/v1alpha1 ScaledObject:

if err := r.Delete(ctx, scaledObject); err != nil && !errors.IsNotFound(err) {
    return ctrl.Result{}, err
}

When KEDA is not installed, the keda.sh API group is not registered, so the RESTMapper returns a *meta.NoKindMatchErrornot a NotFound. The existing guard only tolerates errors.IsNotFound(err), so the reconcile errored out and requeued forever.

Fix

Also tolerate meta.IsNoMatchError(err) on this cleanup path. If the CRD is absent there is nothing to delete, so the reconcile should succeed. The autoscaling-enabled path (reconcileScaledObject) is unchanged — enabling autoscaling legitimately requires KEDA.

Two-line change plus an explanatory comment; no behavior change on clusters that do have KEDA.

Testing

  • Verified the guard now short-circuits on NoKindMatchError (returned by controller-runtime's client when the keda.sh/v1alpha1 group/kind is unregistered), which is precisely the KEDA-absent case.

🤖 Generated with Claude Code

The VLLMRuntime controller reconciled a stale ScaledObject delete in the
autoscaling-disabled branch, guarding only errors.IsNotFound. On a cluster
without KEDA the keda.sh/v1alpha1 API group is not registered, so the
delete returns a NoKindMatchError rather than NotFound, and every
reconcile failed -- making the operator unusable on clusters that never
requested autoscaling.

Also tolerate meta.IsNoMatchError on the cleanup path: there is nothing to
delete when the CRD is absent, so the reconcile should succeed.

Fixes vllm-project#981

Signed-off-by: Tai An <antai12232931@outlook.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the VLLMRuntimeReconciler to tolerate meta.IsNoMatchError when attempting to delete a ScaledObject during cleanup when autoscaling is disabled. This ensures that the reconciliation succeeds on Kubernetes clusters where KEDA is not installed, making the operator usable in non-autoscaling environments. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: The VLLMRuntime controller fails on every reconciliation when running on a cluster that does not have KEDA installed

1 participant