<p>Until now I worked a lot with github/bitbucket and jenkins/bamboo. Right now I'm trying to setup a Gitlab CE server with a private kubernetes cluster.</p>

<p>I want to run a hello world project in java with gitlabs AutoDevOps in kubernetes, this is the repo I'm using:
<a href="https://github.com/dstar55/docker-hello-world-spring-boot" rel="nofollow noreferrer">https://github.com/dstar55/docker-hello-world-spring-boot</a></p>

<p>Everything works fine until runner gets created in kubernetes, downloads the image but gets stuck on downloading maven resources.</p>

<pre><code> Running on runner-h6cwaztm-project-8-concurrent-0jvd9f via runner-gitlab-runner-6dcf7dd458-jl69h...
Fetching changes with git depth set to 50...
00:02
 Initialized empty Git repository in /builds/.../hello-world-spring/.git/
 Created fresh repository.
 From https://.../hello-world-spring
  * [new ref]         refs/pipelines/14 -&gt; refs/pipelines/14
  * [new branch]      master            -&gt; origin/master
 Checking out ad24ac6b as master...
 Skipping Git submodules setup
$ if [[ -z "$CI_COMMIT_TAG" ]]; then # collapsed multi-line command
 $ /build/build.sh
 Logging to GitLab Container Registry with CI credentials...
 WARNING! Using --password via the CLI is insecure. Use --password-stdin.
 WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
 Configure a credential helper to remove this warning. See
 https://docs.docker.com/engine/reference/commandline/login/#credentials-store
 Login Succeeded
 Building Dockerfile-based application...
 Step 1/10 : FROM maven:3.5.2-jdk-8-alpine AS maven_build
 3.5.2-jdk-8-alpine: Pulling from library/maven

 22bc7fb81913: Pull complete
 Digest: sha256:7cebda60f8a541e1bf2330306d22f9786f989187f4ec96539d398a0d4dbfdadb
 Status: Downloaded newer image for maven:3.5.2-jdk-8-alpine
  ---&gt; 293423a981a7
 Step 2/10 : COPY pom.xml /tmp/
  ---&gt; c0e609a509a8
 Step 3/10 : COPY src /tmp/src/
  ---&gt; e735a08f2b39
 Step 4/10 : WORKDIR /tmp/
  ---&gt; Running in 90620c0ca3ad
 Removing intermediate container 90620c0ca3ad
  ---&gt; a5d9fdc62aa9
 Step 5/10 : RUN mvn package
  ---&gt; Running in dc90f43fc83b
 [INFO] Scanning for projects...
 Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.2.1.RELEASE/spring-boot-starter-parent-2.2.1.RELEASE.pom
</code></pre>

<p>It never throws an error (until it timesout) and it never goes past this point.
Kubernetes has 4 nodes 1 master and 3 slaves, using flannel and MetalLB</p>

<p>Edit:</p>

<p>I added a curl command instead of mvn package and it seems the download speed is 0, how is that possible?</p>

<pre><code> Step 5/11 : RUN curl https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.2.1.RELEASE/spring-boot-starter-parent-2.2.1.RELEASE.pom --output test.pom
  ---&gt; Running in db2bc24c6a4f
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
   0     0    0     0    0     0      0      0 --:--:--  0:05:00 --:--:--     0
 curl: (28) Operation timed out after 300689 milliseconds with 0 out of 0 bytes received
 The command '/bin/sh -c curl https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.2.1.RELEASE/spring-boot-starter-parent-2.2.1.RELEASE.pom --output test.pom' returned a non-zero code: 28
 ERROR: Job failed: command terminated with exit code 1
</code></pre>

<p>According to place where CI hangs, your pipeline stuck at <code>mvn package</code>:</p>

<blockquote>
<pre><code>Step 5/10 : RUN mvn package
  ---&gt; Running in dc90f43fc83b
 [INFO] Scanning for projects...
 Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.2.1.RELEASE/spring-boot-starter-parent-2.2.1.RELEASE.pom
</code></pre>
</blockquote>

<p>So, you can try to restart Artifactory.</p>

<p>Also, you can debug mvn packages with <code>mvn clean package -X -e</code> </p>

<p>See: <a href="https://stackoverflow.com/a/25554841/5720818">this answer</a> :
<a href="https://stackoverflow.com/questions/25553668/maven-hanging-indefinitely-while-checking-for-updates">java - Maven hanging indefinitely while checking for updates - Stack Overflow</a></p>

<pre><code>mvn clean package  -X -e
</code></pre>
