2

I am using Google Kubernetes Engine on Google Cloud Platform (GCP): I am using traefik ingress in GKE.

How do I get the real source IP of the client in the backend services behind traefik ?

I tried setting externalTrafficPolicy: Local in GKE but, the Kubernetes Docs say that it will cause a problem in uniform load balancing.

Can you please help me get the real source IP of the client ?

  • https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip – Mike Doe Feb 17 '20 at 07:57
  • I tried this option. But it is mentioned in the doc that setting externalTrafficPolicy: Local will result in uneven load balancing. Is there a way to solve this issue ? – Prakash Premkumar Feb 17 '20 at 08:29
  • What Kubernetes version on GKE and traefik version are you using? Did you check this thread: https://github.com/containous/traefik/issues/2311 about `X-Forwarded-For`? – PjoterS Feb 17 '20 at 11:25
  • Thank you for your reply, PjotesS Kubernetes Version : Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.12-gke.25", GitTreeState:"clean", BuildDate:"2020-01-14T06:01:20Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"} How do I find traefik ingress version ? The link you provided did not help me. – Prakash Premkumar Feb 17 '20 at 14:39
  • Did you use any tutorials? How did you deploy traefik Helm, own config? You mentioned that you have tried to use externalTrafficPolicy: Local, were you able to get SourceIP or you have issue with LoadBalancing? Could you share your config YAMLs (Traefik, Deployment, Service, etc.)? – PjoterS Feb 27 '20 at 15:23
  • To check traefik version you can use: `kubectl exec -it -n -- traefik version` or `kubectl get pod -n -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image` – PjoterS Feb 27 '20 at 15:24
  • @Prakash Premkumar could you provide information from previous comments? – PjoterS Mar 02 '20 at 10:46

0 Answers0