nginx-ingress-controller: 413 Entity Too Large despite configuring 10g limits

I’m experiencing persistent 413 “Entity Too Large” errors when trying to upload files larger than 500MB through my Odoo 18.0 application running on Kubernetes with nginx-ingress-controller v1.8.1. Despite configuring both global ConfigMap settings and Ingress-specific annotations for 10GB uploads, the error persists.

Cluster information:

Kubernetes version: 1.29+
Cloud being used: Bare-metal (not on a public cloud)
Installation method: kubeadm
Host OS: Ubuntu 22.04 LTS
CNI and version: Calico
CRI and version: containerd

Additional components:

  • nginx-ingress-controller v1.8.1
  • MetalLB LoadBalancer
  • cert-manager for TLS

Problem Details

Current Configuration:

1. ingress-nginx-controller ConfigMap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: ingress-nginx-controller
  namespace: ingress-nginx
data:
  client-max-body-size: "10g"
  client-body-buffer-size: "8m"
  client-body-timeout: "1800"
  proxy-body-size: "10g"
  proxy-read-timeout: "7200"
  proxy-send-timeout: "7200"
  proxy-connect-timeout: "600"
  proxy-request-buffering: "off"

2. Ingress Configuration:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: odoo-demo-18-ingress
  namespace: ns-demo-18
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: "10g"
    nginx.ingress.kubernetes.io/client-max-body-size: "10g"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "7200"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "7200"
    nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
    nginx.ingress.kubernetes.io/client-body-buffer-size: "8m"
    cert-manager.io/cluster-issuer: letsencrypt-prod
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  ingressClassName: nginx
  rules:
  - host: demo18.bytesraw.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: odoo-demo-18
            port:
              number: 8069

What I’ve tried:

  1. Applied global ConfigMap settings with client-max-body-size: "10g"
  2. Added Ingress annotations for body size limits
  3. Restarted ingress-nginx-controller multiple times after configuration changes
  4. Verified ConfigMap is applied correctly
  5. Attempted server-snippet approach to force settings directly

Current nginx config shows conflicting entries:

kubectl exec -n ingress-nginx deployment/ingress-nginx-controller -- nginx -T | grep -i "client_max_body_size"

Results in:

  • Some entries: client_max_body_size 10g; :white_check_mark:
  • Some entries: client_max_body_size 0; :cross_mark:
  • One entry: client_max_body_size 21M; :cross_mark:

Error Logs:

# Ingress Controller Log:
10.244.0.1 - - [18/Jul/2025:18:52:59 +0000] "POST /odooupgrade/submit HTTP/2.0" 413 171

# Odoo Application Log:  
2025-07-18 18:52:59,935 33 INFO test werkzeug: 10.244.0.1 - - [18/Jul/2025 18:52:59] "POST /odooupgrade/submit HTTP/1.1" 413

Questions:

  1. Why are there multiple conflicting client_max_body_size directives in the nginx config?
  2. How can I ensure the 10g limit is applied consistently across all server blocks?
  3. Could SSL termination or MetalLB be interfering with the body size limits?

Expected: Files up to 10GB should upload successfully
Actual: Files over 500MB fail with 413 error immediately

Any help would be greatly appreciated!