Kong confuse the target IP in IPv6

Hi all,
We change the kong service IP from IPv4 to IPv6
The external request was received by kong.
But I found that Kong uses Port to the last when he makes a compressed IP into a full IP.

** ingress-controller catch the endpoint
IP=aaaa:0:0:4::45
port=8080

time="2022-12-09T00:57:46Z" level=debug msg="found endpoints: [{aaaa:0:0:4::45 8080}]" service_name=ves-processor-server service_namespace=test service_port="&ServicePort{Name:https-main,Protocol:TCP,Port:8080,TargetPort:{0 8080 },NodePort:31805,AppProtocol:nil,}" subsystem=proxy-cache-resolver

** But kong make target ip by wrong way.
IP=[aaaa:0000:0000:0004:0000:0000:0045:8080]
port=8000

2022/12/09 00:57:46 [debug] 1110#0: *181 [lua] round_robin.lua:50: afterHostUpdate(): trying to set a round-robin balancer with no addresses
2022/12/09 00:57:46 [debug] 1110#0: *181 [lua] targets.lua:439: queryDns(): querying dns for [aaaa:0000:0000:0004:0000:0000:0045:8080]
2022/12/09 00:57:46 [debug] 1110#0: *181 [lua] targets.lua:354: f(): dns record type changed for [aaaa:0000:0000:0004:0000:0000:0045:8080], nil -> 28
2022/12/09 00:57:46 [debug] 1110#0: *181 [lua] targets.lua:420: f(): updating balancer based on dns changes for [aaaa:0000:0000:0004:0000:0000:0045:8080]
2022/12/09 00:57:46 [debug] 1110#0: *181 [lua] targets.lua:430: f(): querying dns and updating for [aaaa:0000:0000:0004:0000:0000:0045:8080] completed
2022/12/09 00:57:46 [debug] 1110#0: *181 [lua] consistent_hashing.lua:117: afterHostUpdate(): continuum of size 10000 updated with 3 collisions
2022/12/09 00:57:46 [debug] 1110#0: *181 [lua] consistent_hashing.lua:223: new(): consistent_hashing balancer created
2022/12/09 00:57:46 [debug] 1110#0: *181 [lua] balancers.lua:263: create_balancers(): initialized 2 balancer(s), 0 error(s)
127.0.0.1 - - [09/Dec/2022:00:57:46 +0000] "POST /config?check_hash=1 HTTP/1.1" 201 6026 "-" "Go-http-client/1.1"

We tried with latest kong version(3.1.0) , but it was same.

[ENV]

  • OCP
  • k8s
  • metallb
  • KONG_PROXY_LISTEN=0.0.0.0:8081 , [::]:8081, 0.0.0.0:8443 ssl http2 , [::]:8443 ssl http2

[service]

apiVersion: v1
kind: Service
metadata:
  name: kong-proxy
spec:
  allocateLoadBalancerNodePorts: true
  clusterIP: aaaa::1600
  clusterIPs:
  - aaaa::1600
  externalTrafficPolicy: Local
  healthCheckNodePort: 31593
  internalTrafficPolicy: Cluster
  ipFamilies:
  - IPv6
  ipFamilyPolicy: SingleStack
  loadBalancerIP: 2001::43
  ports:
  - name: kong-proxy
    nodePort: 31017
    port: 80
    protocol: TCP
    targetPort: 8081
  - name: kong-proxy-tls
    nodePort: 30652
    port: 8443
    protocol: TCP
    targetPort: 8443
  type: LoadBalancer

※ I changed some IP addresses for security reason.
I tried to add some log in kong lua code in container by root user, but I failed.
How can I add the log?
I added KONG_NGINX_HTTP_LUA_CODE_CACHE=off in env but I failed.

Please help.

Hello,

Did you ever resolve this?

I am seeing the identical issue: the port is being glued into the IPv6 octet chain inappropriately.