Kong / kubernetes-ingress-controller

:gorilla: Kong for Kubernetes: The official Ingress Controller for Kubernetes.
https://docs.konghq.com/kubernetes-ingress-controller/
Apache License 2.0
2.22k stars 592 forks source link

IngressController keep ping backend services #3193

Closed sheltonsuen closed 1 year ago

sheltonsuen commented 1 year ago

Is there an existing issue for this?

Current Behavior

We config a TCPIngress to proxy connections from iot devices to iot services, the functionality is ok, and we can have correct connection between devices and services,

But the console keep print logs as below, something like the IngressController keep trying to ping the iot service: 2022-11-28 16:10:47.946 INFO 1 --- [tLoopGroup-6-10] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:0b978e25,当前client数:1,channel map:1 2022-11-28 16:10:48.091 INFO 1 --- [tLoopGroup-6-11] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:304df245,当前client数:1,channel map:1 2022-11-28 16:10:48.098 INFO 1 --- [tLoopGroup-6-12] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:3728cd47,当前client数:1,channel map:1 2022-11-28 16:10:48.209 INFO 1 --- [tLoopGroup-6-13] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:374edbd9,当前client数:1,channel map:1 2022-11-28 16:10:48.213 INFO 1 --- [tLoopGroup-6-14] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:399ac94b,当前client数:2,channel map:1 2022-11-28 16:10:48.244 INFO 1 --- [tLoopGroup-6-15] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:3c7b32bb,当前client数:1,channel map:1 2022-11-28 16:10:48.373 INFO 1 --- [tLoopGroup-6-16] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:38cf08f5,当前client数:1,channel map:1 2022-11-28 16:10:48.374 INFO 1 --- [ntLoopGroup-6-1] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:e37d8cb4,当前client数:1,channel map:1 2022-11-28 16:10:48.394 INFO 1 --- [ntLoopGroup-6-2] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:3d35a3eb,当前client数:1,channel map:1 2022-11-28 16:10:49.049 INFO 1 --- [ntLoopGroup-6-3] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:b8c4cb23,当前client数:1,channel map:1 2022-11-28 16:10:49.258 INFO 1 --- [ntLoopGroup-6-4] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:0bc46ab5,当前client数:1,channel map:1 2022-11-28 16:10:49.459 INFO 1 --- [ntLoopGroup-6-5] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:80c13680,当前client数:1,channel map:1 2022-11-28 16:10:49.515 INFO 1 --- [ntLoopGroup-6-6] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:8fa4d903,当前client数:1,channel map:1 2022-11-28 16:10:49.546 INFO 1 --- [ntLoopGroup-6-7] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:adcd335a,当前client数:1,channel map:1 2022-11-28 16:10:50.032 INFO 1 --- [ntLoopGroup-6-8] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:b3e92fee,当前client数:1,channel map:1 2022-11-28 16:10:50.201 INFO 1 --- [ntLoopGroup-6-9] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:c1fd3c1b,当前client数:1,channel map:1 2022-11-28 16:10:50.244 INFO 1 --- [tLoopGroup-6-10] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:695bc3d1,当前client数:1,channel map:1 2022-11-28 16:10:50.384 INFO 1 --- [tLoopGroup-6-11] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:32c1cfee,当前client数:1,channel map:1 2022-11-28 16:10:50.602 INFO 1 --- [tLoopGroup-6-12] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:01fe9d1f,当前client数:1,channel map:1 2022-11-28 16:10:50.838 INFO 1 --- [tLoopGroup-6-13] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:a34b808b,当前client数:1,channel map:1 2022-11-28 16:10:51.031 INFO 1 --- [tLoopGroup-6-14] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:51a4ba2e,当前client数:1,channel map:1 2022-11-28 16:10:51.291 INFO 1 --- [tLoopGroup-6-15] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:c870439f,当前client数:1,channel map:1 2022-11-28 16:10:52.065 INFO 1 --- [tLoopGroup-6-16] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:5220b172,当前client数:1,channel map:1 2022-11-28 16:10:52.114 INFO 1 --- [ntLoopGroup-6-1] c.n.d.d.r.handler.RegisterBizHandler : 客户端链接:d5c32c1d,当前client数:1,channel map:1 2022-11-28 16:10:52.163 INFO 1 --- [tLoopGroup-6-13] n.h.LengthFieldBasedFrameCustomerDecoder : 0 --------DECODE READ: 79B

Expected Behavior

Reduce the rate of connections between IngressController and backend services

Steps To Reproduce

1. Configs:

`
apiVersion: configuration.konghq.com/v1beta1
kind: TCPIngress
metadata:
  name: xxx
  namespace: xx
  annotations:
    kubernetes.io/ingress.class: kong
spec:
  rules:
  - port: 9000
    backend:
      serviceName: xxx
      servicePort: 8088
`

Kong Ingress Controller version

kong version: 2.2.1

Kubernetes version

k8s version: 1.21.7

Anything else?

No response

randmonkey commented 1 year ago

Hello, could you please provide the version of Kong Ingress Controller? (look at image of ingress-controller container in your KIC deployment). It seems that the "Kong Ingress Controller version" you provided is the version of kong gateway.

sheltonsuen commented 1 year ago

Hello, could you please provide the version of Kong Ingress Controller? (look at image of ingress-controller container in your KIC deployment). It seems that the "Kong Ingress Controller version" you provided is the version of kong gateway.

@randmonkey thank you for the reply, I have double checked the version of Kong Ingress Controller, the version is: 2.2.1

ingressController:
  enabled: true
  image:
    repository: kong/kubernetes-ingress-controller
    tag: "2.2.1"

and we use helm chart to deploy the kong ande ingresscontroller , and the appversion is as following:

apiVersion: v1
appVersion: "2.7"
description: The Cloud-Native Ingress and API-management
home: https://konghq.com/
icon: https://s3.amazonaws.com/downloads.kong/universe/assets/icon-kong-inc-large.png
maintainers:
- email: harry@konghq.com
  name: hbagdi
- email: traines@konghq.com
  name: rainest
name: kong
version: 2.7.0
rainest commented 1 year ago

Can you provide the console logs as an attachment to fix the newlines? Do you recognize that traffic at all? What do you see with https://docs.konghq.com/kubernetes-ingress-controller/2.7.x/troubleshooting/#inspecting-network-traffic-with-a-tcpdump-sidecar dumping both the downstream (TCPIngress) and upstream (Service) ports?

You shouldn't see proxy-initiated traffic to upstreams unless you've explicitly configured some healthcheck configuration. Normally I'd expect the traffic you're seeing to be something a client actually sent, e.g. if your clients send keepalive pings.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.