Skip to content

Commit 1b414f3

Browse files
committed
fix: haproxy: drain connections when disabling endpoints
sending set-server maint will stop sending traffic to endpoints, which will cause traffic to be dropped. This instructs haproxy to gracefully drain an endpoint while sending new connections to other ready endpoints see [1] for further information on the difference between drain and maint [1] https://www.haproxy.com/documentation/haproxy-configuration-manual/new/latest/management/#section-9.3.-set-server
1 parent 526b4d0 commit 1b414f3

File tree

1 file changed

+1
-1
lines changed
  • pkg/router/template/configmanager/haproxy

1 file changed

+1
-1
lines changed

pkg/router/template/configmanager/haproxy/backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (b *Backend) EnableServer(name string) error {
224224
// DisableServer stops serving traffic for a haproxy backend server.
225225
func (b *Backend) DisableServer(name string) error {
226226
log.V(4).Info("disabling server with maint state", "server", name)
227-
return b.UpdateServerState(name, BackendServerStateMaint)
227+
return b.UpdateServerState(name, BackendServerStateDrain)
228228
}
229229

230230
// Commit commits all the pending changes made to a haproxy backend.

0 commit comments

Comments
 (0)