haproxy Master API load balancers behaving like `balance first` backend rather than `balance source`
haproxy load balancers deployed by openshift-ansible and using the openshift/origin-haproxy-router:v3.9.0 are behaving like they are configured for balance first rather than the defined balance source (from /etc/haproxy/haproxy.cfg)
The previous version which used openshift/origin-haproxy-router:v3.7.2 behaved more as expected.
This MAY or MAY NOT belong to the openshift-ansible project... ENOTSURE
Version
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
79c62be58357 openshift/origin-haproxy-router:v3.9.0 "haproxy -f /etc/h..." 3 hours ago Up 3 hours 53/tcp, 80/tcp, 0.0.0.0:443->443/tcp, 8443/tcp, 0.0.0.0:9000->9000/tcp openshift_loadbalancer
Steps To Reproduce
- Install Openshift Origin 3.9.0 using Openshift Ansible with the
containerized: truesetting andopenshift_master_cluster_method: native - Check the stats Web page at http://${hostname}:9000/ (must be manually enabled by mapping port 9000/tcp in
/etc/systemd/system/haproxy.service)
Current Result
All traffic goes to master0 first and only uses master1 if master0 is down. master2 is only used if both master0 and master1 are down.
Expected Result
Traffic will be distributed roughly across all openshift-master-api containers by the haproxy instances as best as possible given the default hashing methods using source IP address.
Additional Information
Both tcpdumps and logging verify that there is no source IP natting that would cause haproxy to only see a single source IP address for its hashing mechanism. The distribution seemed more even with 3.7.2's container. However, the upgrade updates all of the container tags and restarts the services.
Oh hey, here is the fix:
http://git.haproxy.org/?p=haproxy-1.8.git;a=commit;h=22ca440f0ab444336deadc992059e2b5510b8c1d
Apparently this is an issue that affected all haproxy 1.8's and I don't know off hand if this would have any effect on the use case of the router pod.
I see this in the a running pod's /var/lib/haproxy/conf/haproxy.config
sh-4.2$ ps -auxw | egrep haproxy | egrep -v grep
1000000+ 80420 0.4 0.0 91468 16484 ? Ss 20:26 0:00 /usr/sbin/haproxy -f /var/lib/haproxy/conf/haproxy.config -p /var/lib/haproxy/run/haproxy.pid -x /var/lib/haproxy/run/haproxy.sock -sf 80390
sh-4.2$ egrep -B1 balance.*source /var/lib/haproxy/conf/haproxy.config
backend be_tcp:default:docker-registry
balance source
--
backend be_tcp:default:registry-console
balance source
--
backend be_tcp:kube-service-catalog:apiserver
balance source
--
backend be_tcp:test:gumbyprod
balance source
Yeah looks like this might cause issues in the router pod as well.
Yes, it looks like this will definitely cause all external traffic to the docker-registry or the kube-service-catalog to use the first endpoint in the list? Perhaps it's for every SSL Passthru Route?
Bump? :P I know that I cannot be the only person using SSL Passthru style routes (no termination until container).
@openshift/sig-networking
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Hey its only gone stale because nobody seemed to be concerned :)
On Thu, Oct 4, 2018, 11:31 AM OpenShift Bot [email protected] wrote:
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openshift/origin/issues/20050#issuecomment-427063617, or mute the thread https://github.com/notifications/unsubscribe-auth/AiRB9sioCtvNtT712L39iNbEYtgiPX17ks5uhinVgaJpZM4Uv8sc .
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.
/close
@openshift-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting
/reopen. Mark the issue as fresh by commenting/remove-lifecycle rotten. Exclude this issue from closing again by commenting/lifecycle frozen./close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.