Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes cannot upload files larger than 1MB

Tags:

kubernetes

We have a kubernetes cluster which has a dropwizard based web application running as a service. This application has a rest uri to upload files. It cannot upload files larger than 1MB. I get the following error:

ERROR [2017-07-27 13:32:47,629] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: ea812501b414f0d9
! com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
!  at [Source: <html>
! <head><title>413 Request Entity Too Large</title></head>
! <body bgcolor="white">
! <center><h1>413 Request Entity Too Large</h1></center>
! <hr><center>nginx/1.11.3</center>
! </body>
! </html>

I have tried the suggestions given in https://github.com/nginxinc/kubernetes-ingress/issues/21. I have edited the Ingress to set the proxy-body-size annotation. Also, I have tried using the configMap without any success. we are using kubernetes version 1.5. Please let me know if you need additional information.

like image 530
Arvind Avatar asked Jul 27 '17 15:07

Arvind


1 Answers

Had this on my setup as well. Two advices here:

1: switch to official kubernetes nginx ingress, it's awesome (https://github.com/kubernetes/ingress-nginx)

2: with the above ingress, you can add an annotation to your Ingresses to controll body size limit on per ingress basis like this :

annotations:
  ingress.kubernetes.io/proxy-body-size: 10m

works great

like image 62
Radek 'Goblin' Pieczonka Avatar answered Oct 13 '22 19:10

Radek 'Goblin' Pieczonka