fix(ingress-nginx): raise client keepalive_time above the 1h default

ingress-nginx has no ConfigMap key for the client-side keepalive_time,
so nginx applies its 1h default and closes every HTTP/2 connection
that reaches that age with a GOAWAY. Clients that multiplex a long
operation over a single connection see it fail: a kopia repository
maintenance run by Velero against SeaweedFS lasted just over an hour
and died while listing blobs, with "http2: server sent GOAWAY and
closed the connection; ErrCode=NO_ERROR", because the listing is not
retried.

Set keepalive_time to 12h through http-snippet. Idle connections are
still closed by keep-alive after 75s, so this only lengthens the life
of connections that are actually in use.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
This commit is contained in:
Mattia Eleuteri committed 2026-11-09 10:52:28 +01:00
1 parent 1f35c26ece
commit 5f6679e4cf
2 files changed
+33

No files matched your search

@@ -0,0 +1,26 @@
suite: ingress-nginx client keepalive_time
release:
name: ingress-nginx
namespace: cozy-ingress-nginx
templates:
- charts/ingress-nginx/templates/controller-configmap.yaml
tests:
- it: raises the client keepalive_time above the nginx 1h default
asserts:
- equal:
path: data.http-snippet
value: keepalive_time 12h;
- it: keeps the snippet when a tenant ingress sets its own config keys
# The tenant ingress HelmRelease passes controller.config for whitelist,
# Cloudflare and PROXY protocol; Helm merges maps, so those keys must not
# drop the default snippet.
set:
ingress-nginx.controller.config.use-proxy-protocol: "true"
ingress-nginx.controller.config.whitelist-source-range: 10.0.0.0/8
asserts:
- equal:
path: data.http-snippet
value: keepalive_time 12h;
- equal:
path: data.use-proxy-protocol
value: "true"
@@ -47,6 +47,13 @@ ingress-nginx:
upstream-keepalive-timeout: "60"
upstream-keepalive-connections: "320"
ssl-session-tickets: "true"
# Client-side keepalive_time has no ConfigMap key, so nginx keeps its
# 1h default and sends GOAWAY to any HTTP/2 connection older than that.
# A long S3 operation (kopia maintenance behind Velero) multiplexes its
# requests over one connection, and the in-flight object listing fails
# instead of being retried. Idle connections still close after
# keep-alive (75s).
http-snippet: "keepalive_time 12h;"
resources:
limits:
cpu: "1"