Skip to content

feat(ingress gateway): configure max_connections to upstream service#14708

Closed
huikang wants to merge 9 commits intomainfrom
gh-maxconnections-ingress-gateway
Closed

feat(ingress gateway): configure max_connections to upstream service#14708
huikang wants to merge 9 commits intomainfrom
gh-maxconnections-ingress-gateway

Conversation

@huikang
Copy link
Copy Markdown
Collaborator

@huikang huikang commented Sep 22, 2022

Description

As a user of ingress gateway, I want to increase the max_connections of the service in the ingress-gateway config entry (link to the detailed description). However, in current implementation, max_coonections can’t be changed and set to the default value of 1024 by envoy.

This PR adds a new field named MaxConnections to the service field of ingress-gateway config entry. The new field allows user to configure the max_connections of the upstream cluster of a specified service behind the ingress gateway.

  • added unit test
  • updated doc

Testing & Reproduction steps

Kind = "ingress-gateway"
Name = "my-ingress-gateway"

Listeners = [
 {
   Port = 8082
   Protocol = "http"
   Services = [
     {
        Name = "counting"
        Hosts = ["*"]
        MaxConnections = 5120          // <----- increase the max_connections
     },
     {
       Name = "counting-v2"
       Hosts = ["v2"]
     }
   ]
 }
]
  • envoy cluster
counting.default.dc2.internal.ca9229ae-1b1d-af9d-47fa-43885f09557a.consul::default_priority::max_connections::5120
counting.default.dc2.internal.ca9229ae-1b1d-af9d-47fa-43885f09557a.consul::default_priority::max_pending_requests::1024
counting.default.dc2.internal.ca9229ae-1b1d-af9d-47fa-43885f09557a.consul::default_priority::max_requests::1024
counting.default.dc2.internal.ca9229ae-1b1d-af9d-47fa-43885f09557a.consul::default_priority::max_retries::3

Links

Address #13374

Please be mindful not to leak any customer or confidential information. HashiCorp employees may want to use our internal URL shortener to obfuscate links.

PR Checklist

  • updated test coverage
  • external facing docs updated
  • not a security concern

@huikang huikang requested a review from a team as a code owner September 22, 2022 14:28
@github-actions github-actions bot added theme/api Relating to the HTTP API interface theme/envoy/xds Related to Envoy support type/docs Documentation needs to be created/updated/clarified labels Sep 22, 2022
@huikang huikang force-pushed the gh-maxconnections-ingress-gateway branch from 6fecacb to a45cebe Compare September 22, 2022 14:37
@huikang huikang requested review from a team and kisunji and removed request for a team September 22, 2022 15:05
@huikang huikang changed the title feat(ingress gateway): Add max_connections to upstream service feat(ingress gateway): configure max_connections to upstream service Sep 22, 2022
Copy link
Copy Markdown
Contributor

@kisunji kisunji left a comment

Choose a reason for hiding this comment

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

This looks okay to me but will tag other members for review since I'm not too familiar with ingress gw code

MaxConnections: makeUint32Value(int(svc.MaxConnections)),
},
}
} else {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually the else branch will never happen because

* The Proxy.Upstreams configuration is invalid for a ingress-gateway

Leave it here for safety check.

@kisunji kisunji requested a review from a team September 22, 2022 19:08
Copy link
Copy Markdown
Contributor

@boruszak boruszak left a comment

Choose a reason for hiding this comment

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

I reviewed the docs in this PR, 14708.txt and ingress-gateway.mdx, only. I have one suggestion, but I was unsure of your intent. Please review my comment below, and let me know if you have any questions or need additional assistance.

Approving on behalf of consul-docs.

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
@huikang
Copy link
Copy Markdown
Collaborator Author

huikang commented Sep 26, 2022

superseded by #14749

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

Labels

theme/api Relating to the HTTP API interface theme/envoy/xds Related to Envoy support type/docs Documentation needs to be created/updated/clarified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants