Hi, The key was to set the *haproxy.router.openshift.io/disable_cookies <http://haproxy.router.openshift.io/disable_cookies>* annotation to true.
Regards, Marvin On Mon, Dec 16, 2019 at 9:53 AM Just Marvin < marvin.the.cynical.ro...@gmail.com> wrote: > Dan, > > Thanks for the pointer. It didn't solve my problem. Whats worse, is > that your link is to the 3.11 docs, and I tried the same annotation on a > 3.11 install, and it didn't work there either. I have to demonstrate the > load balancing to a customer, and my cheat was to use the > *haproxy.router.openshift.io/pod-concurrent-connections > <http://haproxy.router.openshift.io/pod-concurrent-connections>* annotation > - when running "ab" with 10 concurrent connections, and > "pods-conccurrent-connections" set to 6. I do see the spill-over traffic > going to the second pod. > > But this is definitely a cheat for me. I would like to get the > "balance" annotation, or whatever is the right approach, working. Is there > a way to troubleshoot this and figure out what is going wrong? > > Regards, > Marvin > > On Mon, Dec 16, 2019 at 8:22 AM Dan Mace <dm...@redhat.com> wrote: > >> >> >> On Mon, Dec 16, 2019 at 8:12 AM Just Marvin < >> marvin.the.cynical.ro...@gmail.com> wrote: >> >>> Hi, >>> >>> In the openshift-ingress/router-default pod, in >>> /var/lib/haproxy/conf/haproxy.config I see: >>> >>> backend be_edge_http:session-persistence:song-demo >>> mode http >>> option redispatch >>> option forwardfor >>> >>> * balance leastconn* >>> timeout check 5000ms >>> http-request set-header X-Forwarded-Host %[req.hdr(host)] >>> http-request set-header X-Forwarded-Port %[dst_port] >>> http-request set-header X-Forwarded-Proto http if !{ ssl_fc } >>> http-request set-header X-Forwarded-Proto https if { ssl_fc } >>> http-request set-header X-Forwarded-Proto-Version h2 if { ssl_fc_alpn >>> -i h2 } >>> # Forwarded header: quote IPv6 addresses and values that may be empty >>> as per https://tools.ietf.org/html/rfc7239 >>> http-request add-header Forwarded >>> for=%[src];host=%[req.hdr(host)];proto=%[req.hdr(X-Forwarded-Proto)];proto-version=\"%[req.hdr(X-Forwarded-Proto-Version)]\" >>> cookie 3e15d2ed54afa750c6c99f3e7974d5f8 insert indirect nocache >>> httponly secure >>> server pod:song-demo-6-tw5qr:song-demo:10.128.0.46:9080 >>> 10.128.0.46:9080 cookie 88434433dbc1caefd053e8d5252218f0 weight 256 >>> check inter 5000ms >>> server pod:song-demo-6-nz8c2:song-demo:10.128.0.47:9080 >>> 10.128.0.47:9080 cookie c67ffb0cd9ed5115a63c2f6b0a39151c weight 256 >>> check inter 5000ms >>> sh-4.2$ >>> >>> I probably want "roundrobin" instead of that, though I would argue >>> the system isn't doing what is implied by "leastconn" either. Is there a >>> way to change that setting to what I need? >>> >>> Regards, >>> Marvin >>> >> >> >> Marvin, >> >> You can try the "haproxy.router.openshift.io/balance" annotation on your >> Route resource to configure the balancing strategy[1]. >> >> >> https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations >> >> >> On Sun, Dec 15, 2019 at 8:21 PM Just Marvin < >>> marvin.the.cynical.ro...@gmail.com> wrote: >>> >>>> Hi, >>>> >>>> I'm using code-ready containers and I've scaled my pod to do, but >>>> when I hit it form a for loop in a shell script, I get back results >>>> indicating that its only being routed to one of the pods. Is there some >>>> setting that I need to tweak to make things load balanced even at low load? >>>> >>>> [zaphod@oc6010654212 session-song-demo]$ oc describe svc song-demo >>>> Name: song-demo >>>> Namespace: session-persistence >>>> Labels: app=song-demo >>>> app.kubernetes.io/component=song-demo >>>> app.kubernetes.io/instance=song-demo >>>> Annotations: openshift.io/generated-by: OpenShiftNewApp >>>> Selector: deploymentconfig=song-demo >>>> Type: ClusterIP >>>> IP: 172.30.140.43 >>>> Port: 9080-tcp 9080/TCP >>>> TargetPort: 9080/TCP >>>> Endpoints: 10.128.0.42:9080,10.128.0.43:9080 >>>> Port: 9443-tcp 9443/TCP >>>> TargetPort: 9443/TCP >>>> Endpoints: 10.128.0.42:9443,10.128.0.43:9443 >>>> Session Affinity: None >>>> Events: <none> >>>> [zaphod@oc6010654212 session-song-demo]$ oc describe route song-demo >>>> Name: song-demo >>>> Namespace: session-persistence >>>> Created: 5 hours ago >>>> Labels: app=song-demo >>>> app.kubernetes.io/component=song-demo >>>> app.kubernetes.io/instance=song-demo >>>> Annotations: <none> >>>> Requested Host: song-demo.apps-crc.testing >>>> exposed on router default (host apps-crc.testing) 5 hours ago >>>> Path: <none> >>>> TLS Termination: edge >>>> Insecure Policy: <none> >>>> Endpoint Port: 9080-tcp >>>> >>>> Service: song-demo >>>> Weight: 100 (100%) >>>> Endpoints: 10.128.0.42:9443, 10.128.0.43:9443, 10.128.0.42:9080 + 1 >>>> more... >>>> [zaphod@oc6010654212 session-song-demo]$ >>>> >>>> Regards, >>>> Marvin >>>> >>> _______________________________________________ >>> users mailing list >>> users@lists.openshift.redhat.com >>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users >>> >> >> >> -- >> >> Dan Mace >> >> Principal Software Engineer, OpenShift >> >> Red Hat >> >> dm...@redhat.com >> >> >>
_______________________________________________ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users