Skip to content

Commit aa15bc1

Browse files
author
Rajat Chopra
committed
allow roundrobin algorithm as a choice in passthrough/reencrypt
1 parent 72fdd09 commit aa15bc1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

images/router/haproxy/conf/haproxy-config.template

+12
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,13 @@ backend be_tcp_{{$cfgIdx}}
252252
{{ if ne (env "ROUTER_SYSLOG_ADDRESS" "") ""}}
253253
option tcplog
254254
{{ end }}
255+
{{ with $balanceAlgo := index $cfg.Annotations "router.openshift.io/haproxy.balance" }}
256+
{{ with $matchValue := (matchValues $balanceAlgo "roundrobin" "leastconn" ) }}
257+
balance {{ $balanceAlgo }}
258+
{{ end }}
259+
{{ else }}
255260
balance {{ env "ROUTER_TCP_BALANCE_SCHEME" "source" }}
261+
{{ end }}
256262
hash-type consistent
257263
timeout check 5000ms
258264
{{ range $serviceUnitName, $weight := $cfg.ServiceUnitNames }}
@@ -269,7 +275,13 @@ backend be_tcp_{{$cfgIdx}}
269275
backend be_secure_{{$cfgIdx}}
270276
mode http
271277
option redispatch
278+
{{ with $balanceAlgo := index $cfg.Annotations "router.openshift.io/haproxy.balance" }}
279+
{{ with $matchValue := (matchValues $balanceAlgo "roundrobin" "leastconn" ) }}
280+
balance {{ $balanceAlgo }}
281+
{{ end }}
282+
{{ else }}
272283
balance leastconn
284+
{{ end }}
273285
timeout check 5000ms
274286
cookie {{$cfg.RoutingKeyName}} insert indirect nocache httponly secure
275287
{{ range $serviceUnitName, $weight := $cfg.ServiceUnitNames }}

0 commit comments

Comments
 (0)