ingress-nginx: Support client_body_timeout annotation
I’d like nginx.ingress.kubernetes.io/client-body-timeout annotation to be propagated to nginx server config.
The feature for grpc timeout annotations was implemented in #11250.
As it stated in the documentation the client_body_timeout must be provided if an app does request or both request and response streaming.
Currently, the only way to configure the client_body_timeout for nginx is by using server snippet.
No.
No.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 19 (18 by maintainers)
ok. You can type /reopen here. The developer guide section of docs has 2 sub-sections that may help if needed https://kubernetes.github.io/ingress-nginx/developer-guide/getting-started/
@longwuyuan thanks for the suggested workaround and prompt reply
From user experience point of view, because of the other timeouts as annotations, it will be nice to have client-body-timeout also as annotation. But that is just user-experience.
The nginx docs is clear that the directive is accepted in all contexts, the perspective of a webserver vs a reverseproxy vs a ingress-controller comes into play. I will need to test the impact of using configMap vs server-snippet vs configuration-snippet. On top of that if there was a annotation existing, it would likely be implemented to be used in the location context.
Now that above part is theory. The practical side is there are no other demands on this directive, in the way that you are requiring, most likely because there are no open issues for timeout on both (request as well as response) streaming.
So because there is nothing broken and because there are no resources available to work on this issue, and configMap works for you, my suggestion is best not to pursue this any further now.
If a developer gets time, then they will comment and commit time so it can/will be taken up then.
Thanks you very much for the feedback as I was thinking that there is no workaround.
@longwuyuan thanks for your suggestion. When
client-body-timeoutis configured in the configmap it is propagated to nginx http (global context). I was not aware of this and it covers my use case. OTOH, when it is specified in theserver-snippetthe timeout is rendered inside a server context, i.e. it is local to the created Ingress. Please let me know if the implementation still make sense as there is a workaround (global timeout).Will check, thanks
@mneverov thanks for posting this. Your expectation seems absolutely valid.
There is shortage of resources. If you have interest to implement the annotation, please discuss in the ingress-nginx-dev channel of the Kubernetes slack. Also you can join community meetings.
But I also request you to study why client-body-timeout is a configMap option currently https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#client-body-timeout . It will take me some reading and testing to get to know this directive as I am not a developer. What is needed to be confirmed is why you can not use it from the configMap
https://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout