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

TCPingress - before(): no Route found with those values while prereading client data (port based routing) #10416

Closed
1 task done
dsnr-coder opened this issue Mar 2, 2023 · 3 comments
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller

Comments

@dsnr-coder
Copy link

dsnr-coder commented Mar 2, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

Kong version: 3.1.1-alpine

Current Behavior

Hi,

I am trying to proxy web application hosted inside a VM via kong through TCP ingress on specific port.
Getting below error in kong logs.

**Error:--**
[error] 54#0: *22895 stream [lua] handler.lua:1067: before(): no Route found with those values while prereading client data, client: 127.0.0.1, server: 0.0.0.0:9000

kubernetes-ingress-controller:2.7.0
Kong version: 3.1.1-alpine

Thanks in advance for your help.

Expected Behavior

When I make the below api call on port 28080, the request should goto kong on port 9000, then kong should redirect the request to external mock-test.service:28080 (TCP) which is hosted in VM.
http://localhost:28080/

From one of the pod, when I am making call directly to mock-test.service:28080 (service), I am getting the response back, but only via kong, I am getting error as below.

**Error:--**
[error] 54#0: *22895 stream [lua] handler.lua:1067: before(): no Route found with those values while prereading client data, client: 127.0.0.1, server: 0.0.0.0:9000

Steps To Reproduce

  1. In kong deployment, I had put the below configuration
- name: KONG_PROXY_LISTEN
   value: 0.0.0.0:8000,0.0.0.0:8443 ssl http2
- name: KONG_STREAM_LISTEN
   value: 0.0.0.0:9000

  ports:
        - containerPort: 9000
          name: stream9000
          protocol: TCP
  1. In kong proxy service, I had put the below configuration
 - name: kong-stream9000
    port: 9000
    protocol: TCP
    targetPort: 9000
  1. Created TCPIngress, KongIngress and Service below
---
apiVersion: configuration.konghq.com/v1beta1
kind: TCPIngress
metadata:
  annotations:
    kubernetes.io/ingress.class: kong
    konghq.com/strip-path: "true"
    konghq.com/preserve-host: "false"
  name: mock-dashboard-service-tcpingress
spec:
  rules:
  - port: 28080
    backend:
      serviceName: mock-dashboard-service
      servicePort: 28080
---
apiVersion: v1
kind: Service
metadata:
  name: mock-dashboard-service
spec:
  externalName: mock-test.service
  ports:
  - port: 28080
    protocol: TCP
    targetPort: 28080
  type: ExternalName

Anything else?

No response

@dsnr-coder dsnr-coder changed the title TCPingress - before(): no Route found with those values while prereading client data TCPingress - before(): no Route found with those values while prereading client data (port based routing) Mar 2, 2023
@hbagdi hbagdi added the area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller label Mar 2, 2023
@hbagdi
Copy link
Member

hbagdi commented Mar 2, 2023

cc @Kong/team-k8s

@dsnr-coder
Copy link
Author

After updating to port 9000 in mock service, it started working...
Thanks all for your help...
If anyone is facing any issue with TCPIngress, please let me know, I am happy to help you..

curiositycasualty pushed a commit that referenced this issue Oct 15, 2024
@rookie-fpc
Copy link

Hi @dsnr-coder
I meet the same problem, could you please have a help?
this is my config:
gateway config:

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: echo-example-gateway
  namespace: default
spec:
  gatewayClassName: kong
  listeners:
  - name: echo-example
    protocol: TCP
    port: 9000
    allowedRoutes:
      kinds:
      - kind: TCPRoute

tcproute config:

apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
  name: echo
spec:
  parentRefs:
  - name: echo-example-gateway
    sectionName: echo-example
  rules:
  - backendRefs:
    - name: echo
      port: 1025

the result is this:

2024/12/11 09:10:31 [info] 1111#0: *175745 client 10.62.109.72:51182 connected to 0.0.0.0:9000
2024-12-11T17:10:31.815183512+08:00 2024/12/11 09:10:31 [error] 1111#0: *175745 stream [lua] handler.lua:1229: before(): no Route found with those values while prereading client data, client: 10.62.109.72, server: 0.0.0.0:9000
2024-12-11T17:10:31.815221049+08:00 10.62.109.72 [11/Dec/2024:09:10:31 +0000] TCP 500 0 0 0.000

thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller
Projects
None yet
Development

No branches or pull requests

3 participants