The nginx ingress controller in my gardener managed cluster uses a client_max_body_size of 1m per default. This applied to all server configurations at /etc/nginx/nginx.conf.
For most scenarios this should be sufficient. However I want to run a docker registry inside the cluster (for demo/testing/training), deployed as stable/docker-registry helm chart.
Since most layers of a docker image are larger than 1m, the nginx ingress controller refuses to accept the packages I send to my registry. A similar problem description can be found here: https://github.com/jwilder/nginx-proxy/issues/39
I haven't found a way to modify or control client_max_body_size with an annotation to my ingress resource or anything else. So unless I hack the ingress controller pod, modify the server config and start nginx, I cannot use ingress resources to expose my registry.
It would be very helpful, if this parameter would become mutable.
I thought that the nginx config is tuneable by the user, see
https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/configmap.md
If I misunderstood:
You can deploy your own ingress (cf. https://github.com/kubernetes/charts/tree/master/stable/nginx-ingress) where you have all the controls at your disposal. Ensure that you use a different tag in controller.ingressClass (!= nginx) .
Please describe which best practice settings you would recommend.
Found a solution: by now there is a parameter that allows to customize the client_max_body_size but it's actually called proxy-body-size.
With the annotation nginx.ingress.kubernetes.io/proxy-body-size it is possible to tune the body size for individual ingress resources.
reference link: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-max-body-size
Thanks for letting us know!
Most helpful comment
Found a solution: by now there is a parameter that allows to customize the client_max_body_size but it's actually called proxy-body-size.
With the annotation
nginx.ingress.kubernetes.io/proxy-body-sizeit is possible to tune the body size for individual ingress resources.reference link: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-max-body-size