Gitlab + GKE + Gitlab CI unable to clone Repository

Hi!

I’m trying to user GitLab CI with GKE cluster to execute pipelines. I have the experience using Docker runner, but GKE is still pretty new to me, here’s what I did:

I. Create GKE cluster via Project settings in GitLab.
II. Install Helm Tiller via GitLab Project settings.
III. Install GitLab Runner via GitLab Project settings.
IV. Create gitlab-ci.yml with the following content

before_script:
  - php -v

standard:
  image: falnyr/php-ci-tools:php-cs-fixer-7.0
  script:
    - php-cs-fixer fix --diff --dry-run --stop-on-violation -v --using-cache=no

lint:7.1:
  image: falnyr/php-ci:7.1-no-xdebug
  script:
    - composer build
    - php vendor/bin/parallel-lint --exclude vendor .

cache:
  paths:
    - vendor/

V. Push commit to the repository
VI. Pipeline output is following

Running with gitlab-runner 10.3.0 (5cf5e19a)
  on runner-gitlab-runner-666dd5fd55-h5xzh (04180b2e)
Using Kubernetes namespace: gitlab-managed-apps
Using Kubernetes executor with image falnyr/php-ci:7.1-no-xdebug ...
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-04180b2e-project-5-concurrent-0tfg8w to be running, status is Pending
Running on runner-04180b2e-project-5-concurrent-0tfg8w via runner-gitlab-runner-666dd5fd55-h5xzh...
Cloning into '/group/project'...
Cloning repository...
remote: Git access over HTTP is not allowed
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@git.domain.tld/group/project.git/': The requested URL returned error: 403
ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1

Now I think that I should add SSH deploy key somewhere, not sure how this works with Pods being created on demand.

Thanks!

1 Like