[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: route not load balancing

On Mon, Dec 16, 2019 at 8:12 AM Just Marvin <marvin the cynical robot gmail com> wrote:

    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="">  cookie 3e15d2ed54afa750c6c99f3e7974d5f8 insert indirect nocache httponly secure
  server pod:song-demo-6-tw5qr:song-demo: cookie 88434433dbc1caefd053e8d5252218f0 weight 256 check inter 5000ms
  server pod:song-demo-6-nz8c2:song-demo: cookie c67ffb0cd9ed5115a63c2f6b0a39151c weight 256 check inter 5000ms

    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?



You can try the "haproxy.router.openshift.io/balance" annotation on your Route resource to configure the balancing strategy[1].


On Sun, Dec 15, 2019 at 8:21 PM Just Marvin <marvin the cynical robot gmail com> wrote:

    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
Annotations:       openshift.io/generated-by: OpenShiftNewApp
Selector:          deploymentconfig=song-demo
Type:              ClusterIP
Port:              9080-tcp  9080/TCP
TargetPort:        9080/TCP
Port:              9443-tcp  9443/TCP
TargetPort:        9443/TCP
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
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:,, + 1 more...
[zaphod oc6010654212 session-song-demo]$ 

users mailing list
users lists openshift redhat com


Dan Mace

Principal Software Engineer, OpenShift

Red Hat

dmace redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]