diff --git a/packages/system/observability-proxy/templates/deployment.yaml b/packages/system/observability-proxy/templates/deployment.yaml index 581c15fde..dd95dfbb6 100644 --- a/packages/system/observability-proxy/templates/deployment.yaml +++ b/packages/system/observability-proxy/templates/deployment.yaml @@ -38,6 +38,10 @@ spec: - --cluster-domain={{ $clusterDomain }} - --root-tenant={{ .Values.observabilityProxy.rootTenant }} - --auth-cache-ttl={{ .Values.observabilityProxy.authCacheTTL }} + {{- /* Below the 300s stream idle timeout of a Cilium Gateway, so a + published tail that stops sending lines is ended by the proxy, + not reset by Envoy. */}} + - --tail-idle-timeout=4m30s ports: - name: http containerPort: 8080 diff --git a/packages/system/observability-proxy/templates/httproute.yaml b/packages/system/observability-proxy/templates/httproute.yaml index 5d4931031..1ddd2f720 100644 --- a/packages/system/observability-proxy/templates/httproute.yaml +++ b/packages/system/observability-proxy/templates/httproute.yaml @@ -22,7 +22,9 @@ spec: port: 80 {{- /* Without a request timeout Cilium leaves Envoy's 15s route default in place, which would cut every tail. The proxy bounds each - request itself, so the route sets none. */}} + request itself, so the route disables it. Envoy's 300s stream + idle timeout still applies; the proxy's tail idle limit stays + below it (see deployment.yaml). */}} timeouts: request: 0s {{- end }} diff --git a/packages/system/observability-proxy/templates/ingress.yaml b/packages/system/observability-proxy/templates/ingress.yaml index 59e79a32b..7c6b1a029 100644 --- a/packages/system/observability-proxy/templates/ingress.yaml +++ b/packages/system/observability-proxy/templates/ingress.yaml @@ -25,8 +25,9 @@ metadata: in batches. */}} nginx.ingress.kubernetes.io/proxy-buffering: "off" {{- /* The controller default is 10s. The longest silence the proxy - allows is a tail with no new line for --tail-idle-timeout (5m), - after which it ends the response itself. */}} + allows is a tail with no new line for --tail-idle-timeout (4m30s), + after which it ends the response itself; before the first byte + the token and access reviews may add up to --request-timeout (1m). */}} nginx.ingress.kubernetes.io/proxy-read-timeout: "360" spec: ingressClassName: {{ $exposeIngress }} diff --git a/packages/system/observability-proxy/tests/deployment_test.yaml b/packages/system/observability-proxy/tests/deployment_test.yaml index ddf9d34b8..978f9e968 100644 --- a/packages/system/observability-proxy/tests/deployment_test.yaml +++ b/packages/system/observability-proxy/tests/deployment_test.yaml @@ -40,6 +40,15 @@ tests: path: spec.template.spec.containers[0].args content: --auth-cache-ttl=10s + # Envoy behind a Cilium Gateway resets a stream after 300s without data + # (envoy.streamIdleTimeoutDurationSeconds), so a silent tail has to be + # ended by the proxy first, or the client sees a reset instead of an end. + - it: ends a silent tail before the Gateway stream idle timeout + asserts: + - contains: + path: spec.template.spec.containers[0].args + content: --tail-idle-timeout=4m30s + - it: falls back to cozy.local when the platform passes no cluster domain asserts: - contains: diff --git a/packages/system/observability-proxy/tests/publishing_test.yaml b/packages/system/observability-proxy/tests/publishing_test.yaml index 0efc3ca82..676c38e08 100644 --- a/packages/system/observability-proxy/tests/publishing_test.yaml +++ b/packages/system/observability-proxy/tests/publishing_test.yaml @@ -3,7 +3,7 @@ suite: observability-proxy public endpoint # Kubernetes bearer token, so the route must pass Authorization and the # /apis/... path through untouched, and must not end a request before the # proxy does: a non-tail request may take up to --request-timeout (1m), and -# a tail may stay silent up to --tail-idle-timeout (5m). Whole objects are +# a tail may stay silent up to --tail-idle-timeout (4m30s). Whole objects are # compared rather than single keys, so an annotation or a field that should # not be there fails the test too. templates: