I have deployed a private Docker registry (image registry:2
) in a Kubernetes cluster and exposed it via an Ingress
. I am using the nginxinc/kubernetes-ingress
(not: kubernetes/ingress-nginx
) NGINX ingress controller.
curl https://my_registry/v2/_catalog
works fine. But docker push
into the registry runs into this error: Pushing
... 100.6MB/100.6MB
... 413 Request Entity Too Large
.
For what I know, this can be mitigated by instructing the NGINX ingres controller to accept larger chunks of data. I have e.g. tried adding the annotation nginx.ingress.kubernetes.io/proxy-body-size: "200m"
into my Ingress
specification (as suggested here) but this has not worked so far.
So what is the right way for instructing an nginxinc/kubernetes-ingress
NGINX ingress controller to accept sufficiently large chunks?
UPDATE I have meanwhile concluded that nginxinc/kubernetes-ingress
does not take its configuration from annotations, but from a ConfigMap
named nginx-config
that resides in the same namespace as the NGINX ingress controller. I have now added such a ConfigMap
with data
client-max-body-size: "200m"
, but the problem still persists.
You need to set Annotation:
nginx.org/client-max-body-size "200m"
I have switched from NGINX Inc.'s to Kubernetes' NGINX ingress controller, and there adding the following annotation to the Ingress
' metadata
proved sufficient:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 500m