How can I identify incoming requests from EKS LoadBalancer on app level?

4/27/2020

I have a k8s service defined as type: LoadBalancer which sets an external LB. Can I identify on application level that an incoming request is routed from the LoadBlancer?

Are there any guaranteed http headers? Can I define custom headers for that service that would be added to all incoming requests?

-- Kludge
amazon-eks
amazon-elb
amazon-web-services
aws-eks
kubernetes

2 Answers

4/28/2020

ELB guide says that:

Application Load Balancers and Classic Load Balancers add X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Port headers to the request.

Have you already been trying using these ones?

-- Nick
Source: StackOverflow

4/27/2020

If your internal ingress is using nginx as an ingress controller you can add a custom header that will indicate that.

-- Yaron Idan
Source: StackOverflow