Skip to content

feat: add overloadManager.maxConnections to EnvoyProxy - #10634

Open
Matopst wants to merge 3 commits into
envoyproxy:mainfrom
Matopst:feat/envoyproxy-max-connections
Open

Matopst wants to merge 3 commits into
envoyproxy:mainfrom
Matopst:feat/envoyproxy-max-connections

Conversation

@Matopst

@Matopst Matopst commented Nov 17, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

Envoy Gateway configures Envoy's overload manager with a limit of 50000 active downstream connections per proxy. The value is hardcoded in the bootstrap template, so the only way to change it today is a spec.bootstrap JSONPatch or Replace. This PR adds a typed field for it, as proposed and discussed in #3604:

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
spec:
  overloadManager:
    maxConnections: 100000
  • New optional field spec.overloadManager.maxConnections (*int64, Minimum=1). It is nested under overloadManager so other overload settings (for example the heap thresholds in Best Practices for Load Shedding in Envoy Gateway #9653 and Envoy's heap overload actions are off for the default proxy, because it has no memory limit #10263) have a place later. Only maxConnections is in scope here.
  • When unset, the 50000 default is applied in code, like the shutdown fields. Existing proxies render an identical bootstrap and are not restarted on upgrade.
  • The value is set in common.BuildProxyArgs, next to the existing IPFamily fallback, so it covers both the Kubernetes and the host infrastructure.
  • spec.bootstrap is still applied after the rendered bootstrap, so existing JSONPatch or Replace customizations of the overload manager keep taking precedence. A unit test covers this.
  • Docs: the overload manager task page now describes the field instead of pointing to Tweaking overload settings in gateway api? #3604. The API reference is regenerated.

Testing, in addition to the unit and CEL tests in this PR:

  • make generate manifests helm-template go.testdata.complete leaves all existing golden files unchanged. The only new test data is for the new case.
  • On a kind cluster with an image built from this branch:
    • maxConnections: 0 is rejected by the API server.
    • With maxConnections: 4, 4 of 7 held connections are served and the listener reports downstream_global_cx_overflow: 3.
    • With 100000, the value appears in the running Envoy's bootstrap (/config_dump).
    • Removing the field brings the proxy Deployment back to the same pod template hash as before the field was set.

Which issue(s) this PR fixes:

Fixes #3604


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: The API was proposed in Tweaking overload settings in gateway api? #3604 before this PR.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Locally: make gen-check, make lint, make go.test.unit, and the EnvoyProxy CEL tests on envtest 1.37.0.)
  • Tests added/updated: New/changed code is covered by appropriate tests.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR.
  • Release notes: Added release-notes/current/new_features/3604-envoyproxy-max-connections.md.
  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed.
  • Scope & compatibility: The PR is reasonably scoped and preserves backward compatibility. The default stays 50000 and unset proxies render an identical bootstrap.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

🤖 Co-written with Claude Code

Make the limit of active downstream connections per Envoy proxy
configurable. It was fixed at 50000 in the bootstrap template.

- New optional field spec.overloadManager.maxConnections (int64, minimum 1).
- Unset keeps the 50000 default, so existing proxies render an identical
  bootstrap and are not restarted.
- Wired through BuildProxyArgs, so it covers both Kubernetes and host mode.
- spec.bootstrap customizations are still applied afterwards and take
  precedence.

Signed-off-by: Matopst <[email protected]>
@Matopst
Matopst requested a review from a team as a code owner November 17, 2026 11:25
@netlify

netlify Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f033ac2
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6afc3f0bce0823baff7e02e5
😎 Deploy Preview https://deploy-preview-10634--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the area/api API-related issues label Nov 17, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T11:51:30.275116Z f033ac2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 184dcb5f9d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread api/v1alpha1/envoyproxy_types.go Resolved
The EnvoyGateway envoyProxy default and EnvoyProxies loaded from files
never go through CRD admission, so a value below 1 reached the bootstrap
and Envoy rejected it. Mirror the Minimum=1 marker in
validateEnvoyProxySpecFatal, like the existing mergeGateways/mergeBackends
check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Matopst <[email protected]>
@Matopst

Matopst commented Nov 17, 2026

Copy link
Copy Markdown
Author

@codex review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tweaking overload settings in gateway api?

1 participant