I am using a pod template that has a Maven container to perform builds. The time it takes for this container to pull artifacts from either a private Nexus repo or Maven Central is extremely slow (over 30 minutes then eventually fails in contrast to less than a minute by other clients not invoked by the Kubernetes plugin - e.g. developer machines). It's so slow that Maven reports the following error (this is just one example):
The Nexus logs report the following error (see this for more info).
I executed into the Maven container (via the below command) invoked by the Kubernetes plugin and checked the CPU/memory utilization using the top command and found the java process that's running the mvn install command to be barely using any resources (e.g. 1% cpu).
Where things get really interesting is when I manually run the same Maven command defined in the sh step. Invoking the mvn install command executes at warp speed and finishes in about 54 seconds. When looking at the resource allocation of the java process while the command is running, I see almost 100% CPU utilization. It downloads artifacts about the same speed from either Nexus or Maven Central.
So the takeaway is that the mvn install command invoked by the Kubernetes plugin runs slow to the point of failure but executing that command manually from a different shell/session runs very fast and works as intended.
I also tried to set org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator.stdinBufferSize to a higher value but that didn't seem to help.
Any thoughts on what this might be?