apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

bug: apisix-ingress-controller cannot close the gateway API

Open FIREcup opened this issue 7 months ago • 2 comments

Current Behavior

I deployed Apisix using Helm, and the GKE cluster doesn't have GRPCRoute and other CRD resources installed. But I close the gateway api:

ingress-controller:
  config:
    disableGatewayAPI: true

Ingress-controller startup is throwing the following error: 2026-04-09T09:43:37.502Z ERROR controller-runtime.controller-runtime.source.EventHandler source/kind.go:71 if kind is a CRD, it should be installed before calling Start {"kind": "GRPCRoute.gateway.networking.k8s.io", "error": "no matches for kind \"GRPCRoute\" in version \"gateway.networking.k8s.io/v1\""}

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

  1. APISIX version: 3.15.0
  2. apisix-ingress-controller version: 2.0.1

Environment

  1. APISIX version: 3.15.0
  2. apisix-ingress-controller version: 2.0.1

FIREcup avatar Apr 09 '26 09:04 FIREcup

The AI ​​analysis suggests that the GRPCRoute resource appears to be not being processed correctly: GatewayReconciler unconditionally watches GRPCRoute.

File: [internal/controller/gateway_controller.go](https://github.com/apache/apisix-ingress-controller/blob/2.0.1/internal/controller/gateway_controller.go)

The SetupWithManager() function contains this:

bdr := ctrl.NewControllerManagedBy(mgr).

For(&gatewayv1.Gateway{}, ...).

Watches(&gatewayv1.GatewayClass{}, ...).

Watches(&gatewayv1.HTTPRoute{}, ...).

Watches(&gatewayv1.GRPCRoute{}, ...).

Watches(&v1alpha1.GatewayProxy{}, ...).

Watches(&corev1.Secret{}, ...)

Here, both HTTPRoute and GRPCRoute are unconditionally watched (...).

The existence checks are only performed on the following:

if pkgutils.HasAPIResource(mgr, &gatewayv1alpha2.TCPRoute{}) { ... }

if pkgutils.HasAPIResource(mgr, &gatewayv1alpha2.TLSRoute{}) { ... }

if pkgutils.HasAPIResource(mgr, &gatewayv1alpha2.UDPRoute{}) { ... }

In other words:

  • TCPRoute / TLSRoute / UDPRoute are protected

  • GRPCRoute is not protected

FIREcup avatar Apr 09 '26 10:04 FIREcup

fixed in https://github.com/apache/apisix-ingress-controller/pull/2672

If there is still a problem, please open it again.

Baoyuantop avatar Apr 10 '26 05:04 Baoyuantop