Bug 1430105
| Summary: | [preview][prod]container do not get original remote client IP address, X-Forwarded-For is incorrect | ||
|---|---|---|---|
| Product: | OpenShift Online | Reporter: | Alex Syrnikov <san> |
| Component: | Routing | Assignee: | Stefanie Forrester <dakini> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | zhaliu |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.x | CC: | aos-bugs, bbennett, jawnsy, xtian, yufchang |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-05-10 16:54:33 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Alex Syrnikov
2017-03-07 21:26:34 UTC
Hi Alex, Thanks for the report! It looks like the ELB needs to be configured with the PROXY protocol so that the original IP address is passed through. It seems that HAProxy is setting correct headers, but is unaware that there's a reverse proxy in front, or does not trust the inbound X-Forwarded-For headers due to configuration. We will take a look and get back to you. Enabled proxy protocol on router:
oc env dc/router ROUTER_USE_PROXY_PROTOCOL=true
Verified ELBs are using TCP protocol:
$ aws elb describe-load-balancers --load-balancer-name "$lb" | jq '[.LoadBalancerDescriptions[]|.ListenerDescriptions]'
[
[
{
"Listener": {
"InstancePort": 80,
"LoadBalancerPort": 80,
"Protocol": "TCP",
"InstanceProtocol": "TCP"
},
"PolicyNames": []
},
{
"Listener": {
"InstancePort": 5000,
"LoadBalancerPort": 5000,
"Protocol": "TCP",
"InstanceProtocol": "TCP"
},
"PolicyNames": []
},
{
"Listener": {
"InstancePort": 443,
"LoadBalancerPort": 443,
"Protocol": "TCP",
"InstanceProtocol": "TCP"
},
"PolicyNames": []
}
]
]
The route can not be accessed now! #oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/caddy-docker.json #oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/edge/service_unsecure.json #oc expose svc service-unsecure #oc get route NAME HOST/PORT PATH SERVICES PORT TERMINATION service-unsecure service-unsecure-alpha.44fs.preview.openshiftapps.com service-unsecure http #curl http://service-unsecure-alpha.44fs.preview.openshiftapps.com curl: (52) Empty reply from server I think we need to follow this guide to set up the ELB: http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html#enable-proxy-protocol-cli This issue has been fixed in the latest version of OpenShift Online, which is available here: https://manage.openshift.com/ |