<p>It's very easy to set up <strong>max request body size</strong> with nginx using <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size" rel="nofollow noreferrer">client_max_body_size</a> directive. How can I do the same with kubernetes  <a href="https://docs.traefik.io/providers/kubernetes-ingress/" rel="nofollow noreferrer">traefik ingress controller</a>. I know there is <a href="https://docs.traefik.io/middlewares/buffering/#maxrequestbodybytes" rel="nofollow noreferrer">maxrequestbodybytes</a> directive to do so but, I'm lost with how to set it up in <strong>yaml</strong> file describing my ingress.</p>

<p>Wasn't so easy to figure this out. There is a funky <a href="https://yaml-multiline.info/" rel="nofollow noreferrer">multiline</a> way of specifying this config in <strong>yaml</strong> file. Please check option <strong>traefik.ingress.kubernetes.io/buffering</strong> to see he pipe (<code>|</code>) oprator in acction.</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: example
  labels:
    domain: example.com
    deployment: production
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/frontend-entry-points: http
    traefik.ingress.kubernetes.io/buffering: |
      maxrequestbodybytes: 31457280
      memrequestbodybytes: 62914560
spec:
  etc....
</code></pre>
