0

I have an application running on a Kubernetes cluster. In the same cluster and a different namespace I have my nginx deployment. The web service of the application has several standard parameters: ingress.general.annotations to handle web traffic. nginx.ingress.kubernetes.io/proxy-body-size: "0" However, when uploading larger than 100mb files to the application (99mb works, 101mb not), I get a 413 entity too large error.

When this application was running on a remote server we never got this issue, so I'm assuming the nginx of the kubernetes cluster is enforcing it's own body size parameters. I've tried adapting the parameters of the ingress-nginx with a helm upgrade command & additional parameters like: --set-string controller.config.proxy-body-size=150m --set-string controller.config.client-max-body-size=150m I've adapted the config map with the same parameters but to no avail.

Is there something I'm missing?

helm upgrade --install nginx-ingress ingress-nginx/ingress-nginx -n platform --version 4.3.0 --namespace platform --set controller.replicaCount=2 --set controller.nodeSelector."kubernetes\.io/os"=linux --set defaultBackend.nodeSelector."kubernetes\.io/os"=linux --set-string controller.config.proxy-body-size=150m --set-string controller.config.client-max-body-size=150m --set controller.service.loadBalancerIP=" 00.00.000.000" --set controller.service.externalTrafficPolicy=Local --force
kind: ConfigMap
apiVersion: v1
metadata:
  name: nginx-ingress-ingress-nginx-controller
  namespace: platform
  uid: 56d779d6-19c2-48fc-95de-fbd2149b3bf6
  resourceVersion: '116031130'
  creationTimestamp: '2023-04-27T09:45:38Z'
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: nginx-ingress
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
    app.kubernetes.io/version: 1.4.0
    helm.sh/chart: ingress-nginx-4.3.0
  annotations:
    meta.helm.sh/release-name: nginx-ingress
    meta.helm.sh/release-namespace: platform
  managedFields:
    - manager: Mozilla
      operation: Update
      apiVersion: v1
      time: '2023-04-27T09:45:38Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:data:
          .: {}
          f:allow-snippet-annotations: {}
        f:metadata:
          f:annotations:
            .: {}
            f:meta.helm.sh/release-name: {}
            f:meta.helm.sh/release-namespace: {}
          f:labels:
            .: {}
            f:app.kubernetes.io/component: {}
            f:app.kubernetes.io/instance: {}
            f:app.kubernetes.io/managed-by: {}
            f:app.kubernetes.io/name: {}
            f:app.kubernetes.io/part-of: {}
            f:app.kubernetes.io/version: {}
            f:helm.sh/chart: {}
    - manager: helm
      operation: Update
      apiVersion: v1
      time: '2023-05-03T13:09:41Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:data:
          f:client-max-body-size: {}
          f:proxy-body-size: {}
data:
  allow-snippet-annotations: 'true'
  client-max-body-size: 150m
  proxy-body-size: 150m
Marnick
  • 11
  • 2
  • 1
    Can you try every solution described here https://imti.co/413-request-entity-too-large/#:~:text=The%20%E2%80%9C413%20Request%20Entity%20Too,adjust%20in%20the%20Nginx%20configuration. – Hackerman May 03 '23 at 17:45
  • @Marnick did Hackerman suggestion to try the solutions described from this [link](https://imti.co/413-request-entity-too-large/#:~:text=The%20%E2%80%9C413%20Request%20Entity%20Too,adjust%20in%20the%20Nginx%20configuration) helped? If so, please post it as answer so other community members can see it too. – James S May 05 '23 at 15:03

1 Answers1

0

As suggested by @Hackerman, kindly check the various troubleshooting/workarounds described from this link

One of the workarounds described is by annotations. In the case of nginx upload limits, use the annotation below:

nginx.ingress.kubernetes.io/proxy-body-size: "0"

The annotation removes any restriction on upload size. Of course, you can set this to a size appropriate to your situation.

James S
  • 1,181
  • 1
  • 7