When trying to upload a 9.3 MB plugin in Jenkins (containing io.fabric8:kubernetes-client:3.1.8), I get an NGinx exception "413 Request Entity Too Large".
Workaround:
kubectl get podskubectl exec -it jenkins-*** -- /bin/bashcd /var/jenkins_home/pluginswget https://my/desired/plugin.hpinginx config tweak needed it seems..
another workaround is to kubectl cp the plugin..
kubectl cp target/plugin.hpi jenkins-pbf3r:/var/jenkins_home/plugins/plugin.hpi
@rawlingsj that seems like a reasonable answer - what is security context of that? (I guess role of user driving kube...)
what is security context of that? (I guess role of user driving kube...)
yeah exactly that
we can increase the size in the nginx config, we did that on fabric8 but first it would be good to perform tests to see what impact that might have to ingress for the cluster. We may also want to allow uploading docker images to the registry which would mean a fair size increase.
I'm hitting that exact case where I need to docker push some image on the registry but the nginx ingress won't allow it.
How can I modify that nginx ingress ?
Comments suggest nginx configuration is stored in a configMap but I checked all of them and I didn't found anything.
I temporarily exec into the nginx-ingress-controller to edit the /etc/nginx.nginx.conf file to change client_max_body_size to 1G on the docker-registry.jx.foo.bar vhost and I reloaded nginx with kill -s HUP $nginx-master-process.
That does the trick but I would like to persist this modification.
You can simply get rid of this error by patching the docker-registry Ingress with the following patch:
$ cat patch-docker-registry.yml
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 2g
With command:
kubectl patch ingress docker-registry --patch "$(cat patch-docker-registry.yml)"
yeah - one thing to watch out for is we've not yet added auth to the registry
for the jenkins plugin upload error smae thing, just set the ingress nginx.ingress.kubernetes.io/proxy-body-size annotation
https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/kubernetes/jenkins.yml#L108
fix will be included for jenkins and registry in the next release
Most helpful comment
You can simply get rid of this error by patching the docker-registry Ingress with the following patch:
With command:
kubectl patch ingress docker-registry --patch "$(cat patch-docker-registry.yml)"