Is this a request for help? yes
What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):
413 request entity too large
Is this a BUG REPORT or FEATURE REQUEST? (choose one): Bug
I am trying to increase the max post size with the ingress controller. We are using the mandatory.yaml from this repo. When I attempt to add the following, it has no affect. Can someone please explain how to make this change? I want to apply this globally in the ingress controller.
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-configuration
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 10m
If this is a FEATURE REQUEST, please:
NGINX Ingress controller version:
Image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1
Kubernetes version (use kubectl version):
ags:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Environment:
uname -a):What happened:
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know:
Closing. Please check https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-max-body-size
@aledbf It doesn't work. I have already looked at this. I am asking for support on figuring out why it isn't working.
I want to apply this globally in the ingress controller.
If you want to change this globally you need to modify the configuration configmap https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#proxy-body-size
Once you change that you can verify the new value using something like
kubectl exec -n ingress-nginx <ingress pod> cat nginx.conf|grep client_max_body_size
@aledbf in my original text above, do I have this applied in the correct location? When I then issue kubectl apply -f mandatory.yaml, it doesn't seem to redeploy in my cluster.
in my original text above, do I have this applied in the correct location?
No. Annotations are valid in Ingress objects.
You should have something like:
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-configuration
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
data:
proxy-body-size: 10m
@aledbf Ok, this now works. We need to update the documentation on this subject, because it is not clear exactly the correct global configuration like you gave me above. A good example would be useful.
@rwmajor2 can you be more explicit? What do you want to see in the docs?
Pull requests are welcome :)
Adding the annotation worked just fine for me:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: my-app-name
namespace: my-namespace
annotations:
kubernetes.io/ingress.class: "nginx"
[...]
nginx.ingress.kubernetes.io/proxy-body-size: 16m
Most helpful comment
Adding the annotation worked just fine for me: