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

IP address captured is worker node IP instead of user IP #132

Closed
rameshlohala opened this issue Sep 27, 2021 · 3 comments
Closed

IP address captured is worker node IP instead of user IP #132

rameshlohala opened this issue Sep 27, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@rameshlohala
Copy link

rameshlohala commented Sep 27, 2021

Bug description

The IP address captured in the events is Kubernetes worker node instead of the user's IP address.

I had also tried enabling proxy protocol to ELB following this documentation https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html

Posthog is deployed on AWS EKS.

IP

Expected behavior

  1. IP address captured in the events should be user's public IP

Environment

  • Deployment platform: aws
  • Chart version/commit: 3.12.0
  • Posthog version: 1.28.0
@rameshlohala rameshlohala added the bug Something isn't working label Sep 27, 2021
@rameshlohala rameshlohala changed the title Source IP address is not captured in events IP address captured is worker node IP instead of user IP Oct 27, 2021
@guidoiaquinti
Copy link
Contributor

👋 Hi @rameshlohala, thank you for your report.

I was able to reproduce your issue and it seems to be due to how the AWS ELB (classic) works. In order to fix the issue, can you try to:

  1. enable the PROXY protocol for the ELB (see official AWS documentation)
  2. add this snippet to your values.yaml and run a helm upgrade:
    # For AWS ELB in L4 (TCP) mode, we need to enable some additional config
    # in the ingress controller in order to get the proper IP address forwarded
    # to our app. Otherwise we'll get the load balancer nodes addresses instead.
    #
    # See: https://kubernetes.github.io/ingress-nginx/user-guide/miscellaneous/#source-ip-address
    ingress-nginx:
      controller:
        config:
          use-proxy-protocol: true
    

?

It should fix your issue.

@rameshlohala
Copy link
Author

@guidoiaquinti I have followed the process that you mentioned above and it is fixed now. Thanks

@guidoiaquinti
Copy link
Contributor

See also PostHog/posthog.com#2554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants