From c37f4588c1ed67766004b481f4328980caa56c84 Mon Sep 17 00:00:00 2001 From: Anatoliy Date: Fri, 12 Feb 2021 00:40:07 +0200 Subject: [PATCH] Create increase-request-size.md (#1183) * Create increase-request-size.md Add documentation for the "--dapr-http-max-request-size" argument for the CLI and "dapr.io/http-max-request-size" annotation #1099 * Update increase-request-size.md Co-authored-by: Mark Fussell --- .../configuration/increase-request-size.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 daprdocs/content/en/operations/configuration/increase-request-size.md diff --git a/daprdocs/content/en/operations/configuration/increase-request-size.md b/daprdocs/content/en/operations/configuration/increase-request-size.md new file mode 100644 index 000000000..b179f42d3 --- /dev/null +++ b/daprdocs/content/en/operations/configuration/increase-request-size.md @@ -0,0 +1,51 @@ +--- +type: docs +title: "How-To: Handle large http body requests" +linkTitle: "Http request body size" +weight: 6000 +description: "Configure http requests that are bigger than 4 MB" +--- + +By default Dapr has a limit for the request body size which is set to 4 MB, however you can change this by defining `dapr.io/http-max-request-size` annotation or `--dapr-http-max-request-size` flag. + + +### Self hosted + +When running in self hosted mode, use the `--dapr-http-max-request-size` flag to configure Dapr to use non-default request body size: + +```bash +dapr run --dapr-http-max-request-size 16 node app.js +``` +This tells Dapr to set maximum request body size to `16` MB. + + +### Kubernetes + +On Kubernetes, set the following annotations in your deployment YAML: +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: myapp + namespace: default + labels: + app: myapp +spec: + replicas: 1 + selector: + matchLabels: + app: myapp + template: + metadata: + labels: + app: myapp + annotations: + dapr.io/enabled: "true" + dapr.io/app-id: "myapp" + dapr.io/app-port: "8000" + dapr.io/http-max-request-size: "16" +... +``` + +## Related links +- [Dapr Kubernetes pod annotations spec]({{< ref kubernetes-annotations.md >}})