Default Envoy Proxy drainTimeout to 240s, matching NGINX
What does this MR do?
Sets the Envoy Proxy connection drain timeout to 240s by default, matching the bundled NGINX Ingress.
When an Envoy Proxy pod stops (rollout, node drain, autoscaler consolidation), Envoy Gateway drains in-flight connections for 60s by default before closing them. The bundled NGINX Ingress allowed 240s for the same thing through its default worker-shutdown-timeout, together with the /wait-shutdown preStop hook and terminationGracePeriodSeconds: 300. So moving from NGINX to Gateway API cut the time long-running requests, such as large Git clones and pushes, get to finish.
| NGINX Ingress (previous default) | Envoy Gateway before this MR | Envoy Gateway after this MR | |
|---|---|---|---|
| Longest time in-flight connections get to finish | worker-shutdown-timeout 240s |
drainTimeout 60s |
drainTimeout 240s |
Pod terminationGracePeriodSeconds |
300 | 360 (Envoy Gateway sets it to drainTimeout + 300s) |
540 |
Changes:
values.yaml:gatewayApiResources.envoy.proxySpec.shutdown.drainTimeout: 240s. Helm deep-mergesproxySpec, so existing user overrides of otherproxySpeckeys keep this default. Settingshutdown.drainTimeoutoverrides it.- Docs: new "Connection draining on shutdown" section in the Envoy Gateway migration guide, next to the existing NGINX → Gateway API timeout mapping.
- Specs: the default and a merged override.
Envoy's shutdown manager exits as soon as the connection count drops to zero (after minDrainDuration, 10s by default). The longer limit applies while any downstream connection is open. That includes idle HTTP/1.1 keep-alive connections, which Envoy does not close when draining (NGINX does). So on busy instances, each Envoy Proxy pod takes about 240s instead of about 60s to stop during rollouts and node drains. Measured in the E2E validation, which also covers a possible follow-up.
Not changed on purpose: healthCheckFailureDelay and minDrainDuration. These keep the proxy serving while an external load balancer (for example an AWS NLB) removes the pod from its targets. NGINX had no equivalent enabled by default (--shutdown-grace-period is 0), and the right values depend on the load balancer. The docs point to them.
Sources
Versions match what the chart bundles: ingress-nginx controller v1.15.1 and Envoy Gateway v1.10.0 (gateway-helm in Chart.yaml). The Envoy Gateway shutdown defaults and code are unchanged from v1.9.3.
NGINX Ingress:
worker-shutdown-timeoutdefaults to240s: ingress-nginx ConfigMap docs, source at v1.15.1 (config.go). It sets the NGINXworker_shutdown_timeoutdirective, which closes connections still open when the timeout expires during a graceful shutdown.--shutdown-grace-perioddefaults to0: ingress-nginx CLI arguments, source at v1.15.1 (flags.go).- Shutdown sequence (
nginx -s quit, then wait for the process to stop): source at v1.15.1 (nginx.go). terminationGracePeriodSeconds: 300and the/wait-shutdownpreStop hook in this chart:charts/nginx-ingress/values.yamland lines 1011-1022.
Envoy Gateway:
ShutdownConfigfields and defaults (drainTimeout60s,minDrainDuration10s,healthCheckFailureDelay0s): Envoy Gateway API reference, source at v1.10.0 (envoyproxy_types.go).- Pod
terminationGracePeriodSecondsis 360 by default anddrainTimeout+ 300s when set: source at v1.10.0 (resource_provider.go). - Drain loop (exits after
minDrainDurationonce connections reach zero, or atdrainTimeout): source at v1.10.0 (shutdown_manager.go). - How the settings work together: Envoy Gateway graceful shutdown task.
Related issues
Raised on https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/instrumentor/-/merge_requests/9331#note_4259937772, where GitLab Dedicated set drainTimeout: 300s, healthCheckFailureDelay: 30s and minDrainDuration: 30s after seeing connection resets on long Git transfers during node drains.
Author checklist
For general guidance, please follow our Contributing guide.
Required
For anything in this list which will not be completed, please provide a reason in the MR discussion.
- Merge Request Title and Description are up to date, accurate, and descriptive.
- MR targeting the appropriate branch.
- MR has a green pipeline.
- Documentation created/updated.
- Tests added/updated.
- Have you validated that your change works end-to-end on a real cluster deployment?
- Describe how you did it in a comment. See !5625 (comment 4267075034)
- Equivalent MR/issue for omnibus-gitlab opened. Not applicable: Omnibus does not use Envoy Gateway.
- When ready for review, MR is marked as ready (not a draft) and assigned to a reviewer.
Reviewers checklist
- As soon as you begin reviewing, select Start a review on your first comment so the MR shows Reviewer started review.
- MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab.
- Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab chart.