Skip to content

support route status reporting and stale status cleanup for GRPCRoute, TCPRoute, and TLSRoute #14293

Description

@ApurveKaranwal

kgateway version

v2.0.0-dev (main branch)

Kubernetes Version

v1.30.0 (or any supported k8s version)

Describe the bug

kgateway does not clean up stale status reports for orphaned/detached GRPCRoute, TCPRoute, and TLSRoute resources when their ParentRefs are removed or when they become orphaned.

Additionally, the Status field is completely dropped during the conversion of TLSRoute across different API versions (e.g. v1/v1alpha3 -> internal v1alpha2), which prevents the translator from recognizing existing status entries for TLSRoutes.

Expected Behavior

When a GRPCRoute, TCPRoute, or TLSRoute is detached or orphaned, its stale status reports should be successfully cleared from the resource (matching the existing behavior for HTTPRoute).

During version conversion of TLSRoute (e.g., in pkg/pluginsdk/collections/tlsroute_version.go), the Status field should be fully preserved.

Steps to reproduce the bug

  1. Deploy a Gateway and a GRPCRoute (or TCPRoute/TLSRoute) attached to it.
  2. Verify that the route's status shows accepted/programmed for the Gateway parent.
  3. Delete the Gateway or remove the parentRefs from the route spec.
  4. Inspect the route status (e.g. kubectl get GRPCRoute -o yaml).
  5. Notice that the old parent status entry under status.parents is still present and stale (has not been cleared).

Helm Values

Default helm values used.

Kgateway pod logs

N/A (Logic/design bug in status reporting).

Proxy pod logs

N/A

Additional Environment Detail

N/A

Additional Context

The bug resides in:

pkg/kgateway/proxy_syncer/proxy_syncer.go:
go

// Only HTTP routes had status markers processed:
objStatus := krt.Fetch(kctx, s.commonCols.Routes.GetHTTPRouteStatusMarkers())
s.commonCols.Routes.ProcessHTTPRouteStatusMarkers(objStatus, merged)
pkg/pluginsdk/collections/tlsroute_version.go: convertTLSRouteV1ToV1Alpha2 and convertTLSRouteV1Alpha3ToV1Alpha2 did not copy the Status field from input to output.

pkg/pluginsdk/collections/tlsroute_version.go: convertTLSRouteV1ToV1Alpha2 and convertTLSRouteV1Alpha3ToV1Alpha2 did not copy the Status field from input to output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions