0

Inside my cluster, there is a service that returns 413 when requested via POST with a large request client body size, > 10MB. Since this service should not be reachable from outside the cluster I am wondering how to increase this setting in order to prevent the above error.

Sure, when using an ingress configuration on the service I can stick to the proxy-body-size annotation, but how is it when not using an ingress configuration?

leidenheit
  • 46
  • 9
  • 3
    You don't share the details, you should be fine to do the similar `nginx.ingress.kubernetes.io/proxy-body-size: 50m` for your web service's configuration, depend on which one you choice in your application, haproxy, nginx, or others. – BMW Mar 10 '20 at 23:40
  • @attidev Have that solved your problem? – Wytrzymały Wiktor Mar 11 '20 at 09:44
  • @BMW Do you mean that I should define an ingress resource for that service and annotate it with `nginx.ingress.kubernetes.io/proxy-body-size: 50m`? – leidenheit Mar 11 '20 at 09:50
  • @OhHiMark not yet. In the first place, the question remains. – leidenheit Mar 11 '20 at 11:59
  • You have some sort of pod with a container running an `nginx` or `apache`? And you do not have an ingress right? Than you have to configure the type of webserver running on your pod. – whymatter Mar 11 '20 at 22:21

1 Answers1

1

It seems there is no limitation on request-body-size when a service has not defined an ingress resource.

Edit: Exemplary, we got two services hosted in our cluster A and B. Service A will be reachable from outside the cluster which will be achieved by defining an nginx ingress resource which exposes to the url my.service.a.

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
  ...
spec:
  rules:
    - host: my.service.a
    http:
      paths:
      ...

Please take note of the annotation nginx.ingress.kubernetes.io/proxy-body-size: "0" which disables the limitation of client request body size (not recommended!).

Service B will only be requested by Service A within its internal cluster address my-service-b.svc.cluster.local and therefore no nginx ingress resource has been defined for Service B.

My assumption was, that Service B has by default a client_request_body_size limitation too. But after testing, it seems that there is no limitation.

leidenheit
  • 46
  • 9