Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The RequestRedirect filter on a Kubernetes Gateway API HTTPRoute leads to logs spamming in the KIC controller #6535

Open
1 task done
konsti opened this issue Sep 30, 2024 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@konsti
Copy link

konsti commented Sep 30, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I create an HTTPRoute that uses the RequestRedirect filter, my controller instance spams logs like:

2024-09-30T15:10:24Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:27Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:30Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:33Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:36Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:39Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:42Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:45Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:48Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:51Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:54Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:10:57Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:11:00Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:11:03Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:11:06Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:11:09Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:11:12Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}
2024-09-30T15:11:15Z  info  No targets found to create upstream {"v": 0, "service_name": "httproute.namespace.route-name.0"}

The actual redirect works.

Expected Behavior

No info log spam regarding the upstream targets is being created.

Steps To Reproduce

  1. Deploy the KIC
  2. Create a HTTPRoute:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: route-name
  namespace: namespace
spec:
  hostnames:
    - app.domain.example
  parentRefs:
    - group: gateway.networking.k8s.io
      kind: Gateway
      name: kong
      namespace: kong-system
  rules:
    - filters:
        - requestRedirect:
            hostname: app.domain.example
            path:
              replaceFullPath: /chat
              type: ReplaceFullPath
            port: 443
            scheme: https
            statusCode: 302
          type: RequestRedirect
      matches:
        - path:
            type: PathPrefix
            value: /

Kong Ingress Controller version

3.3.0

Kubernetes version

Server Version: v1.30.4+k3s1

Anything else?

No response

@konsti konsti added the bug Something isn't working label Sep 30, 2024
@konsti
Copy link
Author

konsti commented Oct 1, 2024

Also here: Kong/kong#13724

@randmonkey
Copy link
Contributor

randmonkey commented Oct 8, 2024

@konsti KIC would log a warning message if an HTTPRoute have no backend in a rule or the backend service has no available targets, since the translated Kong service does not have a target is likely to be unavailable.
Since we are now having the redirect filter which does not need a target for the service, I think we can remove it in the condition where the redirect filter is added (or some kind of redirect plugin attached).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants