I have deployed a service on EKS cluster(v1.13) configured with traefik(v1.7). I have whitelisted the source IPs and enabled Proxyprotocol on ELB as well. I am not able to get the client's real IP. Here is how I have configured.
traefik.toml
[entryPoints.https.whiteList]
sourceRange = ["10.100.0.0/16"]
useXForwardedFor = true
[entryPoints.https.proxyProtocol]
trustedIPs = ["10.100.0.0/16"]
[entryPoints.https.forwardedHeaders]
trustedIPs = ["10.100.0.0/16"]
Ingress object:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-nginx
annotations:
kubernetes.io/ingress.class: "test-dev"
traefik.ingress.kubernetes.io/preserve-host: "true"
ingress.kubernetes.io/whitelist-x-forwarded-for: "true"
traefik.ingress.kubernetes.io/whitelist-source-range: "10.100.0.0/16"
spec:
rules:
- host: test-nginx.example.com
http:
paths:
- path: /
backend:
serviceName: nginx-headers
servicePort: 80
Output:
$ curl https://test-nginx.example.com/
Hostname: nginx-headers-5f544s5cc3-sl5c6
IP: 127.0.0.1
IP: 10.100.0.57
GET / HTTP/1.1
Host: test-nginx.example.com
User-Agent: curl/7.64.1
Accept: */*
Accept-Encoding: gzip
X-Forwarded-For: 54.31.147.124, 10.100.0.57
X-Forwarded-Host: test-nginx.example.com
X-Forwarded-Port: 443
X-Forwarded-Proto: https
X-Forwarded-Server: test-dev-traefik-7549d898bc-ttjf4
X-Real-Ip: 10.100.0.57
Am I missing something here? Any help would be highly appreciated.