From 5f6679e4cff70b6e37535920427004259af8adac Mon Sep 17 00:00:00 2001 From: Mattia Eleuteri Date: Mon, 9 Nov 2026 10:52:28 +0100 Subject: [PATCH] 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 --- .../tests/client_keepalive_time_test.yaml | 26 +++++++++++++++++++ packages/system/ingress-nginx/values.yaml | 7 +++++ 2 files changed, 33 insertions(+) create mode 100644 packages/system/ingress-nginx/tests/client_keepalive_time_test.yaml diff --git a/packages/system/ingress-nginx/tests/client_keepalive_time_test.yaml b/packages/system/ingress-nginx/tests/client_keepalive_time_test.yaml new file mode 100644 index 000000000..bb492e57c --- /dev/null +++ b/packages/system/ingress-nginx/tests/client_keepalive_time_test.yaml @@ -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" diff --git a/packages/system/ingress-nginx/values.yaml b/packages/system/ingress-nginx/values.yaml index fca145843..1cb7b58da 100644 --- a/packages/system/ingress-nginx/values.yaml +++ b/packages/system/ingress-nginx/values.yaml @@ -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"