-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added max-conns annotation #614
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vrrs
Thanks a lot for taking the time to write this PR!
Just a few small changes required and we'll get this merged shortly!
- Add max-conns entry to annotation doc: https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/configmap-and-annotations.md#backend-services-upstreams
- Necessary to add MaxConns to createUpstream of ingress.go for annotation to function correctly - https://github.com/nginxinc/kubernetes-ingress/blob/master/internal/configs/ingress.go#L291
@Dean-Coakley Made the changes suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm once: #614 (comment) is applied
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vrrs looks good! ty
just a small doc problem left.
docs/configmap-and-annotations.md
Outdated
@@ -164,6 +164,7 @@ spec: | |||
| `nginx.org/grpc-services` | N/A | Enables gRPC for services. Note: requires HTTP/2 (see `http2` ConfigMap key); only works for Ingresses with TLS termination enabled. | N/A | [GRPC Services Support](../examples/grpc-services).| | |||
| `nginx.org/websocket-services` | N/A | Enables WebSocket for services. | N/A | [WebSocket support](../examples/websocket). | | |||
| `nginx.org/max-fails` | `max-fails` | Sets the value of the [max_fails](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_fails) parameter of the `server` directive. | `1` | | | |||
| `nginx.org/max-conns` | `max-conns` | Sets the value of the [max_conns](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_conns) parameter of the `server` directive. | `0` | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small doc problem, the max-conns
ConfigMap is not supported, so it has to be removed from the doc:
| `nginx.org/max-conns` | `max-conns` | Sets the value of the [max_conns](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_conns) parameter of the `server` directive. | `0` | | | |
| `nginx.org/max-conns` | N/A | Sets the value of the [max_conns](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_conns) parameter of the `server` directive. | `0` | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pleshakov done
Proposed changes
These changes enable the annotation max-conns which set the parameter max_conns on upstream server in nginx config. For instance,
nginx.org/max-conns: 6
on ingress.yaml should add to ngnix configHere it's the documentation for max_conn https://nginx.org/en/docs/http/ngx_http_upstream_module.html
Use case
This parameter is very useful on load balancing long lived connections and limiting load on the destination servers.
Checklist
Before creating a PR, run through this checklist and mark each as complete.