skip to Main Content

I’m trying to deploy the GitLab Runner (15.7.1) onto an on-premise Kubernetes cluster and getting the following error:

PANIC: loading system ID file: saving system ID state file: creating directory: mkdir /.gitlab-runner: permission denied

This is occurring with both the 15.7.1 image (Ubuntu?) and the alpine3.13-v15.7.1 image. Looking at the deployment, it looks likes it should be trying to use /home/gitlab-runner, but for some reason it is trying to use root (/), which is a protected directory.

Anyone else experience this issue or have a suggestion as to what to look at?

I am using the Helm chart (0.48.0) using a copy of the images from dockerhub (simply moved into a local repository as internet access is not available from the cluster). Connectivity to GitLab appears to be working, but the error causes the overall startup to fail. Full logs are:

Registration attempt 4 of 30
Runtime platform arch=amd64 os=linux pid=33 revision=6d480948 version=15.7.1
WARNING: Running in user-mode.
WARNING: The user-mode requires you to manually start builds processing:
WARNING: $ gitlab-runner run
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner…

Created missing unique system ID system_id=r_Of5q3G0yFEVe
PANIC: loading system ID file: saving system ID state file: creating directory: mkdir /.gitlab-runner: permission denied

I have tried the 15.7.1 image, the alpine3.13-v15.7.1 image, and the gitlab-runner-ocp:amd64-v15.7.1 image and searched the values.yaml for anything relevant to the path. Looking at the deployment template, it appears that it ought to be using /home/gitlab-runner as the directory (instead of /) [though the docs suggested it was /home].

As for "what was I expecting", of course I was expecting that it would "just work" 🙂

2

Answers


  1. Chosen as BEST ANSWER

    So, resolved this (and other) issues with:

    1. Updated helm deployment template to mount an empty volume at /.gitlab-runner
    2. [separate issue] explicitly added builds_dir and environment [per gitlab-org/gitlab-runner#3511 (comment 114281106)].

    These two steps appeared to be sufficient to get the Helm chart deployment working.


  2. You can easily create and mount the emptyDir (in case you are creating gitlab-runner with kubernetes manifest *.yml file):

        volumes:
          - emptyDir: {}
            name: gitlab-runner
        volumeMounts:
          - name: gitlab-runner
            mountPath: /.gitlab-runner
    

    ——————– OR ——————–

        volumeMounts:
          - name: root-gitlab-runner
            mountPath: /.gitlab-runner
        volumes:
          - name: root-gitlab-runner
            emptyDir:
              medium: "Memory"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search