GitLab Runner on OpenShift not working

Hey,
I run an full functional OpenShift/OKD Cluster, my main GitLab instance works very well. Now I wan’t to install the GitLab Runner Operator, everything works well, but when I setup a runner. the runner doesn’t come up. I use the following yaml Files to setup an an Runner instance.

apiVersion: apps.gitlab.com/v1beta2
kind: Runner
metadata:
  name: gitlab-runner
spec:
  gitlabUrl: https://gitlab.domain.tld
  buildImage: alpine
  token: gitlab-runner-secret
  tags: openshift

i also created a runner-registration secret with the following content.

apiVersion: v1
kind: Secret
metadata:
  name: gitlab-runner-secret
type: Opaque
stringData:
runner-registration-token: SECRET

When I go to the GitLab Runner Operator, click the instance and show me the yaml content of the created runner I get the following:

apiVersion: apps.gitlab.com/v1beta2
kind: Runner
metadata:
  creationTimestamp: '2022-07-16T22:36:08Z'
  finalizers:
    - finalizer.gitlab.com
  generation: 1
  name: contentways-runner
  namespace: gitlab-runner
  resourceVersion: '119020'
  uid: 6a1fdb9d-6ff9-47ac-9810-3b291facfaa1
spec:
  buildImage: alpine
  gitlabUrl: 'https://gitlab.domain.tld'
  imagePullPolicy: Always
  runUntagged: true
  tags: openshift
  token: gitlab-runner-secret
status:
  phase: Waiting

What I am doing wrong, why the runner don’t get up?

ERROR: Job failed (system failure): prepare environment: setting up credentials: secrets is forbidden: User "system:serviceaccount:gitlab-runners:gitlab-runner-sa" cannot create resource "secrets" in API group "" in the namespace "gitlab-runners". Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information  duration_s=0.1053084 job=22 project=3 runner=EZZwtQiP
27
WARNING: Failed to process runner                   builds=0 error=prepare environment: setting up credentials: secrets is forbidden: User "system:serviceaccount:gitlab-runners:gitlab-runner-sa" cannot create resource "secrets" in API group "" in the namespace "gitlab-runners". Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information executor=kubernetes runner=EZZwtQiP
28
WARNING: Checking for jobs... failed                runner=EZZwtQiP status=couldn't execute POST against https://gitlab.contentways.eu/api/v4/jobs/request: Post "https://gitlab.contentways.eu/api/v4/jobs/request": EOF
29
WARNING: Checking for jobs... failed                runner=EZZwtQiP status=couldn't execute POST against https://gitlab.contentways.eu/api/v4/jobs/request: Post "https://gitlab.contentways.eu/api/v4/jobs/request": EOF
30
WARNING: Checking for jobs... failed                runner=EZZwtQiP status=couldn't execute POST against https://gitlab.contentways.eu/api/v4/jobs/request: Post "https://gitlab.contentways.eu/api/v4/jobs/request": EOF
31
WARNING: Checking for jobs... failed                runner=EZZwtQiP status=couldn't execute POST against https://gitlab.contentways.eu/api/v4/jobs/request: Post "https://gitlab.contentways.eu/api/v4/jobs/request": EOF
32
WARNING: Checking for jobs... failed                runner=EZZwtQiP status=couldn't execute POST against https://gitlab.contentways.eu/api/v4/jobs/request: Post "https://gitlab.contentways.eu/api/v4/jobs/request": EO

This is the log from the Gitlab Runner, who was created during CI/CD, hope anyone can help me please.

No one here, who can help me??

ERROR: Job failed (system failure): prepare environment: setting up credentials: secrets is forbidden: User "system:serviceaccount:gitlab-runner:gitlab-runner-sa" cannot create resource "secrets" in API group "" in the namespace "gitlab-runner". Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

This is the error I get, when I run CI/CD Pipelines

Well, according to Gitlab docs, you are doing it differently than what is described: Install GitLab Runner Operator | GitLab

Maybe try following the docs? Also, as you probably see, not many people use OpenShift so that also reduces the amount of help you can get. I use Gitlab on a normal VM, and my runner also runs on a standard VM and there seems to be more people who run that way. Maybe in the future it will change and more people who use Gitlab on OpenShift will post and help out here.

For now, try following the Gitlab documentation for setting it up on OpenShift 4.x. There is also this configuration link: Configuring GitLab Runner on OpenShift | GitLab

Got the same error…