4

I would like to have 100k tcp connections with single pod on google container engine.

Below is my test.

  1. create 2 cluster : cluster-1( at asia-east1-c ), cluster-2( at us-central1-b )
  2. cluster-1 : service, rc with replicas 1, so one pod which is tcp server
  3. cluster-2 : just rc with replicas 2, so two pods which is tcp client
  4. kubectl exec -it 'cluster-1 pod' -- /bin/bash
    within that pod
    ifconfig => ip address : 10.121.0.7
    ss -tanp => remote peer : 10.121.0.1

Upper result means that single pod cannot have more than 64K tcp connection because remote peer ip address is fixed at 10.121.0.1 regardless of real clients' ip addresses.

Is there any way to get 100k tcp connections with single pod at google container engine?

ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214
Bigcapital
  • 41
  • 1
  • 4
  • 1
    I found this article. http://stackoverflow.com/questions/36464890/how-to-access-client-ip-of-an-http-request-from-google-container-engine Within that article, "I assume you set up your service by setting the service's type to LoadBalancer? It's an unfortunate limitation of the way incoming network-load-balanced packets are routed through Kubernetes right now that the client IP gets lost." That makes tcp connections number limitation. Why have not Google fixed this huge problem until now? – Bigcapital May 19 '16 at 04:40
  • another article [link](http://stackoverflow.com/questions/32723675/gce-k8s-accessing-referral-ip-address/32728510#32728510) – Bigcapital May 19 '16 at 04:53
  • Is this fixed or does this problem still persist as of 2018 – Angad Jun 24 '18 at 14:49
  • Is This issue fixed or still persists – Venkata Satya Karthik Varun Ku Mar 25 '22 at 09:48

1 Answers1

1

As mentioned by Alex in this article ,

As per your requirement, I assume you set up your service by setting the service's type to LoadBalancer? It's an unfortunate limitation of the way incoming network-load-balanced packets are routed through Kubernetes right now that the client IP gets lost. That makes tcp connections number limitation.

Instead of using the service as a LoadBalancer type, try to setup Ingress to integrate your service with Google Cloud LB which will add the header to incoming requests.