Kubernetes | init-permissions | prepare_script: Permission denied

Hello,

I am attempting to initiate a GitLab CI/CD pipeline. The Kubernetes pod starts successfully, but during the “preparing environment” phase, I encounter a “permission denied” error. Could you provide assistance in resolving this issue?

I expect the pipeline to proceed without encountering a “permission denied” error during the “preparing environment” phase. However, I am currently facing this issue, preventing the pipeline from progressing as intended.

I am using GitLab (self-managed).

Pipeline

stages:
  - build
  
job_build:
  stage: build
  script:
    - echo "Building the project"

Kustomization

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: gitlab-runner
spec:
  values:
    replicas: 1
    imagePullPolicy: IfNotPresent
    gitlabUrl: https://git.xxxxxxxx.com
    runnerToken: glrt-a2rWMB1vosxxxxxxxx
    rbac:
      create: true
      rules: 
        - apiGroups: [""]
          resources: ["*"] (yes i know i try everything)
          verbs: ["*"]
    runners:
      config: |
        [[runners]]
        log_level = "debug"
          [runners.kubernetes]
          image = "alpine"
          privileged = true

Logs

/bin/bash: line 1: /scripts-201-23309/prepare_script: Permission denied
image

I thought I was missing some default values but not still the same problem… Does anyone have a clue?

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: gitlab-runner
spec:
  values:
    # Template: https://gitlab.com/gitlab-org/charts/gitlab-runner/blob/main/values.yaml
    image:
      registry: registry.gitlab.com
      image: gitlab-org/gitlab-runner
    useTini: false
    imagePullPolicy: IfNotPresent
    gitlabUrl: https://git.xxxxxx.com
    runnerToken: "glrt-a2rxxxxxxxxxxxxxxxxx"
    terminationGracePeriodSeconds: 3600
    concurrent: 10
    shutdown_timeout: 0
    checkInterval: 30
    sessionServer:
      enabled: false
    rbac:
      create: true
      rules:
        - resources: ["configmaps", "events", "pods", "pods/attach", "pods/exec", "secrets", "services"]
          verbs: ["get", "list", "watch", "create", "patch", "update", "delete"]
        - apiGroups: [""]
          resources: ["pods/exec"]
          verbs: ["create", "patch", "delete"]
      clusterWideAccess: false
      podSecurityPolicy:
        enabled: false
        resourceNames:
        - gitlab-runner
    metrics:
      enabled: false
      portName: metrics
      port: 9252
      serviceMonitor:
        enabled: false
    service:
      enabled: false
      type: ClusterIP
    runners:
      config: |
        [[runners]]
          [runners.kubernetes]
            namespace = "{{.Release.Namespace}}"
            image = "alpine"
      configPath: ""
      cache: {}
    securityContext:
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: false
      runAsNonRoot: true
      privileged: false
      capabilities:
        drop: ["ALL"]
    podSecurityContext:
      runAsUser: 100
      fsGroup: 65533
    resources: {}
    affinity: {}
    nodeSelector: {}
    tolerations: []
    hostAliases: []
    deploymentAnnotations: {}
    deploymentLabels: {}
    podAnnotations: {}
    podLabels: {}
    priorityClassName: ""
    secrets: []
    configMaps: {}
    volumeMounts: []
    volumes: []

here the helper config:

kind: Pod
apiVersion: v1
metadata:
  name: runner-a2rwmb1vo-project-201-concurrent-0-xevrebtt
  namespace: services-interne
  uid: 8e915b36-875c-4b7a-9d24-510d2c23008c
  resourceVersion: '3151214'
  creationTimestamp: '2023-10-15T18:20:52Z'
  labels:
    pod: runner-a2rwmb1vo-project-201-concurrent-0
  managedFields:
    - manager: gitlab-runner 16.4.1 (16-4-stable; go1.20.5; linux
      operation: Update
      apiVersion: v1
      time: '2023-10-15T18:20:52Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:job.runner.gitlab.com/before_sha: {}
            f:job.runner.gitlab.com/id: {}
            f:job.runner.gitlab.com/name: {}
            f:job.runner.gitlab.com/ref: {}
            f:job.runner.gitlab.com/sha: {}
            f:job.runner.gitlab.com/url: {}
            f:project.runner.gitlab.com/id: {}
          f:labels:
            .: {}
            f:pod: {}
        f:spec:
          f:affinity: {}
          f:containers:
            k:{"name":"build"}:
              .: {}
              f:command: {}
              f:env:
                .: {}
                xxxxxxxx (some lines removed)
                k:{"name":"GITLAB_USER_NAME"}:
                  .: {}
                  f:name: {}
                  f:value: {}
                k:{"name":"RUNNER_TEMP_PROJECT_DIR"}:
                  .: {}
                  f:name: {}
                  f:value: {}
              f:image: {}
              f:imagePullPolicy: {}
              f:name: {}
              f:resources: {}
              f:securityContext:
                .: {}
                f:capabilities:
                  .: {}
                  f:drop: {}
              f:stdin: {}
              f:terminationMessagePath: {}
              f:terminationMessagePolicy: {}
              f:volumeMounts:
                .: {}
                k:{"mountPath":"/builds"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
                k:{"mountPath":"/logs-201-23320"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
                k:{"mountPath":"/scripts-201-23320"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
            k:{"name":"helper"}:
              .: {}
              f:command: {}
              f:image: {}
              f:imagePullPolicy: {}
              f:name: {}
              f:resources: {}
              f:securityContext:
                .: {}
                f:capabilities:
                  .: {}
                  f:drop: {}
              f:stdin: {}
              f:terminationMessagePath: {}
              f:terminationMessagePolicy: {}
              f:volumeMounts:
                .: {}
                k:{"mountPath":"/builds"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
                k:{"mountPath":"/logs-201-23320"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
                k:{"mountPath":"/scripts-201-23320"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
          f:dnsPolicy: {}
          f:enableServiceLinks: {}
          f:imagePullSecrets:
            .: {}
            k:{"name":"runner-a2rwmb1vo-project-201-concurrent-0-mv0t5ytu"}: {}
          f:initContainers:
            .: {}
            k:{"name":"init-permissions"}:
              .: {}
              f:command: {}
              f:image: {}
              f:imagePullPolicy: {}
              f:name: {}
              f:resources: {}
              f:securityContext:
                .: {}
                f:capabilities:
                  .: {}
                  f:drop: {}
              f:terminationMessagePath: {}
              f:terminationMessagePolicy: {}
              f:volumeMounts:
                .: {}
                k:{"mountPath":"/builds"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
                k:{"mountPath":"/logs-201-23320"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
                k:{"mountPath":"/scripts-201-23320"}:
                  .: {}
                  f:mountPath: {}
                  f:name: {}
          f:restartPolicy: {}
          f:schedulerName: {}
          f:securityContext: {}
          f:terminationGracePeriodSeconds: {}
          f:volumes:
            .: {}
            k:{"name":"logs"}:
              .: {}
              f:emptyDir: {}
              f:name: {}
            k:{"name":"repo"}:
              .: {}
              f:emptyDir: {}
              f:name: {}
            k:{"name":"scripts"}:
              .: {}
              f:emptyDir: {}
              f:name: {}
    - manager: kubelet
      operation: Update
      apiVersion: v1
      time: '2023-10-15T18:20:56Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:status:
          f:conditions:
            k:{"type":"ContainersReady"}:
              .: {}
              f:lastProbeTime: {}
              f:lastTransitionTime: {}
              f:status: {}
              f:type: {}
            k:{"type":"Initialized"}:
              .: {}
              f:lastProbeTime: {}
              f:lastTransitionTime: {}
              f:status: {}
              f:type: {}
            k:{"type":"Ready"}:
              .: {}
              f:lastProbeTime: {}
              f:lastTransitionTime: {}
              f:status: {}
              f:type: {}
          f:containerStatuses: {}
          f:hostIP: {}
          f:initContainerStatuses: {}
          f:phase: {}
          f:podIP: {}
          f:podIPs:
            .: {}
            k:{"ip":"10.0.0.140"}:
              .: {}
              f:ip: {}
          f:startTime: {}
      subresource: status
spec:
  volumes:
    - name: repo
      emptyDir: {}
    - name: scripts
      emptyDir: {}
    - name: logs
      emptyDir: {}
    - name: kube-api-access-cxm74
      projected:
        sources:
          - serviceAccountToken:
              expirationSeconds: 3607
              path: token
          - configMap:
              name: kube-root-ca.crt
              items:
                - key: ca.crt
                  path: ca.crt
          - downwardAPI:
              items:
                - path: namespace
                  fieldRef:
                    apiVersion: v1
                    fieldPath: metadata.namespace
        defaultMode: 420
  initContainers:
    - name: init-permissions
      image: >-
        registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-d89a789a
      command:
        - sh
        - '-c'
        - >-
          touch /logs-201-23320/output.log && (chmod 777
          /logs-201-23320/output.log || exit 0)
      resources: {}
      volumeMounts:
        - name: scripts
          mountPath: /scripts-201-23320
        - name: logs
          mountPath: /logs-201-23320
        - name: repo
          mountPath: /builds
        - name: kube-api-access-cxm74
          readOnly: true
          mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      imagePullPolicy: IfNotPresent
      securityContext:
        capabilities:
          drop:
            - NET_RAW
  containers:
    - name: build
      image: alpine
      command:
        - sh
        - '-c'
        - "if [ -x /usr/local/bin/bash ]; then\n\texec /usr/local/bin/bash \nelif [ -x /usr/bin/bash ]; then\n\texec /usr/bin/bash \nelif [ -x /bin/bash ]; then\n\texec /bin/bash \nelif [ -x /usr/local/bin/sh ]; then\n\texec /usr/local/bin/sh \nelif [ -x /usr/bin/sh ]; then\n\texec /usr/bin/sh \nelif [ -x /bin/sh ]; then\n\texec /bin/sh \nelif [ -x /busybox/sh ]; then\n\texec /busybox/sh \nelse\n\techo shell not found\n\texit 1\nfi\n\n"
      env:
        - name: FF_CMD_DISABLE_DELAYED_ERROR_LEVEL_EXPANSION
          value: 'false'
        - name: FF_NETWORK_PER_BUILD
          value: 'false'
        - name: FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY
          value: 'false'
        - name: FF_USE_DIRECT_DOWNLOAD
          value: 'true'
        - name: FF_SKIP_NOOP_BUILD_STAGES
          value: 'true'
        - name: FF_USE_FASTZIP
          value: 'false'
        - name: FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR
          value: 'false'
        - name: FF_ENABLE_BASH_EXIT_CODE_CHECK
          value: 'false'
        - name: FF_USE_WINDOWS_LEGACY_PROCESS_STRATEGY
          value: 'true'
        - name: FF_USE_NEW_BASH_EVAL_STRATEGY
          value: 'false'
        - name: FF_USE_POWERSHELL_PATH_RESOLVER
          value: 'false'
        - name: FF_USE_DYNAMIC_TRACE_FORCE_SEND_INTERVAL
          value: 'false'
        - name: FF_SCRIPT_SECTIONS
          value: 'false'
        - name: FF_USE_NEW_SHELL_ESCAPE
          value: 'false'
        - name: FF_ENABLE_JOB_CLEANUP
          value: 'false'
        - name: FF_KUBERNETES_HONOR_ENTRYPOINT
          value: 'false'
        - name: FF_POSIXLY_CORRECT_ESCAPES
          value: 'false'
        - name: FF_USE_IMPROVED_URL_MASKING
          value: 'false'
        - name: FF_RESOLVE_FULL_TLS_CHAIN
          value: 'false'
        - name: FF_DISABLE_POWERSHELL_STDIN
          value: 'false'
        - name: FF_USE_POD_ACTIVE_DEADLINE_SECONDS
          value: 'false'
        - name: FF_USE_ADVANCED_POD_SPEC_CONFIGURATION
          value: 'false'
        - name: FF_SET_PERMISSIONS_BEFORE_CLEANUP
          value: 'true'
        - name: FF_SECRET_RESOLVING_FAILS_IF_MISSING
          value: 'true'
        - name: FF_RETRIEVE_POD_WARNING_EVENTS
          value: 'false'
        - name: CI_RUNNER_SHORT_TOKEN
          value: a2rWMB1vo
        - name: CI_BUILDS_DIR
          value: /builds
        - name: CI_PROJECT_DIR
          value: /builds/services-interne-helm/portainer
        - name: CI_CONCURRENT_ID
          value: '0'
        - name: CI_CONCURRENT_PROJECT_ID
          value: '0'
        - name: CI_SERVER
          value: 'yes'
        - name: CI_JOB_STATUS
          value: running
        - name: CI_JOB_TIMEOUT
          value: '3600'
        - name: CI_SERVER_TLS_CA_FILE
          value: |-
            -----BEGIN CERTIFICATE-----
            MIIFcDCCBFigAwIBAgIQCTSav19MLBkThoevFOtdmzANBgkqhkiG9w0BAQsFADBG
            MQswCQYDVQQGEwJVxxxxxxxQ5xGWHqvUKKCNWClW1JpXd54OnNkiAq
            PCL695uIctzmSGZPrYQcGMI2xHZ/
            cmzMjopaHDDm6y/LkwJaIgyNszK0MPGXohpRNsy1uKDc37BzDDDz/9C9lk6Ww5+G
            7pkpZ3llo3LdS/9jA5iGUQlSlje4w8p1Go/ONYVKGBYrAQu5XU47+cWyL81V71bI
            +14Zgg==
            -----END CERTIFICATE-----
            -----BEGIN CERTIFICATE-----
            MIIFjDCCA3SgAwIBAgINAgO8UKMnU/CRgCLt8TANBgkqhkiG9w0BAQsFADBHMQsw
            CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU
            MBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMjAwODEzMDAwMDQyWhcNMjcwOTMwMDAw
            MDQyWjBGExxxxxxxxxxxxxx7YbaIiom0F+yzy8VDloNHYnzV9/HCrWSoC8b6w
            0/H4zRK5aiWQW+OFIOb12stAHBk0IANhd7p/SA9JCynr52Fkx2PRR+sc4e6URu85
            c8zuTyuN3PtYp7NlIJmVuftVb9eWbpQ99HqSjmMd320=
            -----END CERTIFICATE-----
            -----BEGIN CERTIFICATE-----
            MIIFVzCCAz+gAwIBAgINAgPlk28xsBNJiGuiFzANBgkqhkiG9w0BAQwFADBHMQsw
            CQYDVQQGEwJVUzxxxxxxxR2CQzreExZBfMzQsNhFRAbd03OIozUhfJFfbdT
            6u9AWpQKXCBfTkBdYiJ23//OYb2MI3jSNwLgjt7RETeJ9r/tSQdirpLsQBqvFAnZ
            0E6yove+7u7Y/9waLd64NnHi/Hm3lCXRSHNboTXns5lndcEZOitHTtNCjv0xyBZm
            2tIMPNuzjsmhDYAPexZ3FL//2wmUspO8IFgV6dtxQ/PeEMMA3KgqlbbC1j+Qa3bb
            bP6MvPJwNQzcmRk13NfIRmPVNnGuV/u3gm3c
            -----END CERTIFICATE-----
            -----BEGIN CERTIFICATE-----
            MIIFYjCCBEqgAwIBAgIQd70NbNs2+RrqIQ/E8FjTDTANBgkqhkiG9w0BAQsFADBX
            MQswCQYDVQQGEwJCRxxxxxxxXn1hIVw41oeQa1v1vg4Fv74zPl6/AhSrw
            9U5pCZEt4Wi4wStz6dTZ/CLANx8LZh1J7QJVj2fhMtfTJr9w4z30Z209fOU0iOMy
            +qduBmpvvYuR7hZL6Dupszfnw0Skfths18dG9ZKb59UhvmaSGZRVbNQpsg3BZlvi
            d0lIKO2d1xozclOzgjXPYovJJIultzkMu34qQb9Sz/yilrbCgj8=
            -----END CERTIFICATE-----
            -----BEGIN CERTIFICATE-----
            MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
            A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
            b3QgQ0ExGzAZBgNVBAxxxxxxx65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
            HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
            -----END CERTIFICATE-----
        - name: CI_PIPELINE_ID
          value: '5716'
        - name: CI_PIPELINE_URL
          value: >-
            https://git.xxxxxxx.com/services-interne-helm/portainer/-/pipelines/5716
        - name: CI_JOB_ID
          value: '23320'
        - name: CI_JOB_URL
          value: >-
            https://git.xxxxxxx.com/services-interne-helm/portainer/-/jobs/23320
        - name: CI_JOB_STARTED_AT
          value: '2023-10-15T18:20:52Z'
        - name: CI_REGISTRY_USER
          value: gitlab-ci-token
        - name: CI_DEPENDENCY_PROXY_USER
          value: gitlab-ci-token
        - name: CI_JOB_NAME
          value: job_build
        - name: CI_JOB_NAME_SLUG
          value: job-build
        - name: CI_JOB_STAGE
          value: build
        - name: CI_NODE_TOTAL
          value: '1'
        - name: CI
          value: 'true'
        - name: GITLAB_CI
          value: 'true'
        - name: CI_SERVER_URL
          value: https://git.xxxxxxxx.com
        - name: CI_SERVER_HOST
          value: git.xxxxxxxx.com
        - name: CI_SERVER_PORT
          value: '443'
        - name: CI_SERVER_PROTOCOL
          value: https
        - name: CI_SERVER_SHELL_SSH_HOST
          value: git.xxxxxxxx.com
        - name: CI_SERVER_SHELL_SSH_PORT
          value: '22'
        - name: CI_SERVER_NAME
          value: GitLab
        - name: CI_SERVER_VERSION
          value: 16.4.1-ee
        - name: CI_SERVER_VERSION_MAJOR
          value: '16'
        - name: CI_SERVER_VERSION_MINOR
          value: '4'
        - name: CI_SERVER_VERSION_PATCH
          value: '1'
        - name: CI_SERVER_REVISION
          value: 229bc5f5985
        - name: GITLAB_FEATURES
        - name: CI_PROJECT_ID
          value: '201'
        - name: CI_PROJECT_NAME
          value: portainer
        - name: CI_PROJECT_TITLE
          value: Portainer
        - name: CI_PROJECT_DESCRIPTION
        - name: CI_PROJECT_PATH
          value: services-interne-helm/portainer
        - name: CI_PROJECT_PATH_SLUG
          value: services-interne-helm-portainer
        - name: CI_PROJECT_NAMESPACE
          value: services-interne-helm
        - name: CI_PROJECT_NAMESPACE_ID
          value: '419'
        - name: CI_PROJECT_ROOT_NAMESPACE
          value: services-interne-helm
        - name: CI_PROJECT_URL
          value: https://git.xxxxxxxx.com/services-interne-helm/portainer
        - name: CI_PROJECT_VISIBILITY
          value: private
        - name: CI_PROJECT_REPOSITORY_LANGUAGES
          value: mustache
        - name: CI_PROJECT_CLASSIFICATION_LABEL
        - name: CI_DEFAULT_BRANCH
          value: main
        - name: CI_CONFIG_PATH
          value: .gitlab-ci.yml
        - name: CI_PAGES_DOMAIN
          value: example.com
        - name: CI_PAGES_URL
          value: http://services-interne-helm.example.com/portainer
        - name: CI_REGISTRY
          value: gitregistry.xxxxxxxx.com:443
        - name: CI_REGISTRY_IMAGE
          value: gitregistry.xxxxxxxx.com:443/services-interne-helm/portainer
        - name: CI_DEPENDENCY_PROXY_SERVER
          value: git.xxxxxxxx.com:443
        - name: CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX
          value: >-
            git.xxxxxxxx.com:443/services-interne-helm/dependency_proxy/containers
        - name: CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX
          value: >-
            git.xxxxxxxx.com:443/services-interne-helm/dependency_proxy/containers
        - name: CI_API_V4_URL
          value: https://git.xxxxxxx.com/api/v4
        - name: CI_API_GRAPHQL_URL
          value: https://git.xxxxxxx.com/api/graphql
        - name: CI_TEMPLATE_REGISTRY_HOST
          value: registry.gitlab.com
        - name: CI_PIPELINE_IID
          value: '79'
        - name: CI_PIPELINE_SOURCE
          value: web
        - name: CI_PIPELINE_CREATED_AT
          value: '2023-10-15T18:20:38Z'
        - name: CI_PIPELINE_NAME
        - name: CI_COMMIT_SHA
          value: 51b38f99ade25f1b1e3e17cbfdaa994aac0309cc
        - name: CI_COMMIT_SHORT_SHA
          value: 51b38f99
        - name: CI_COMMIT_BEFORE_SHA
          value: '0000000000000000000000000000000000000000'
        - name: CI_COMMIT_REF_NAME
          value: main
        - name: CI_COMMIT_REF_SLUG
          value: main
        - name: CI_COMMIT_BRANCH
          value: main
        - name: CI_COMMIT_MESSAGE
          value: Update .gitlab-ci.yml file
        - name: CI_COMMIT_TITLE
          value: Update .gitlab-ci.yml file
        - name: CI_COMMIT_DESCRIPTION
        - name: CI_COMMIT_REF_PROTECTED
          value: 'true'
        - name: CI_COMMIT_TIMESTAMP
          value: '2023-10-13T16:54:02+00:00'
        - name: CI_COMMIT_AUTHOR
          value: Sid xxxxxxx
        - name: CI_RUNNER_ID
          value: '83'
        - name: CI_RUNNER_DESCRIPTION
        - name: CI_RUNNER_TAGS
          value: '[]'
        - name: GITLAB_USER_ID
          value: '1'
        - name: GITLAB_USER_EMAIL
          value: s.xxxxxxx@xxxxxx.fr
        - name: GITLAB_USER_LOGIN
          value: s.djellali
        - name: GITLAB_USER_NAME
          value: Sid Ahmed Djellali
        - name: CI_DISPOSABLE_ENVIRONMENT
          value: 'true'
        - name: CI_RUNNER_VERSION
          value: 16.4.1
        - name: CI_RUNNER_REVISION
          value: d89a789a
        - name: CI_RUNNER_EXECUTABLE_ARCH
          value: linux/amd64
        - name: RUNNER_TEMP_PROJECT_DIR
          value: /builds/services-interne-helm/portainer.tmp
      resources: {}
      volumeMounts:
        - name: scripts
          mountPath: /scripts-201-23320
        - name: logs
          mountPath: /logs-201-23320
        - name: repo
          mountPath: /builds
        - name: kube-api-access-cxm74
          readOnly: true
          mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      imagePullPolicy: Always
      securityContext:
        capabilities:
          drop:
            - NET_RAW
      stdin: true
    - name: helper
      image: >-
        registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-d89a789a
      command:
        - sh
        - '-c'
        - "if [ -x /usr/local/bin/bash ]; then\n\texec /usr/local/bin/bash \nelif [ -x /usr/bin/bash ]; then\n\texec /usr/bin/bash \nelif [ -x /bin/bash ]; then\n\texec /bin/bash \nelif [ -x /usr/local/bin/sh ]; then\n\texec /usr/local/bin/sh \nelif [ -x /usr/bin/sh ]; then\n\texec /usr/bin/sh \nelif [ -x /bin/sh ]; then\n\texec /bin/sh \nelif [ -x /busybox/sh ]; then\n\texec /busybox/sh \nelse\n\techo shell not found\n\texit 1\nfi\n\n"
      resources: {}
      volumeMounts:
        - name: scripts
          mountPath: /scripts-201-23320
        - name: logs
          mountPath: /logs-201-23320
        - name: repo
          mountPath: /builds
        - name: kube-api-access-cxm74
          readOnly: true
          mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      imagePullPolicy: IfNotPresent
      securityContext:
        capabilities:
          drop:
            - NET_RAW
      stdin: true
  restartPolicy: Never
  terminationGracePeriodSeconds: 0
  dnsPolicy: ClusterFirst
  serviceAccountName: default
  serviceAccount: default
  nodeName: k8s02
  securityContext: {}
  imagePullSecrets:
    - name: runner-a2rwmb1vo-project-201-concurrent-0-mv0t5ytu
  affinity: {}
  schedulerName: default-scheduler
  tolerations:
    - key: node.kubernetes.io/not-ready
      operator: Exists
      effect: NoExecute
      tolerationSeconds: 300
    - key: node.kubernetes.io/unreachable
      operator: Exists
      effect: NoExecute
      tolerationSeconds: 300
  priority: 0
  enableServiceLinks: true
  preemptionPolicy: PreemptLowerPriority
status:
  phase: Running
  conditions:
    - type: Initialized
      status: 'True'
      lastProbeTime: null
      lastTransitionTime: '2023-10-15T18:20:54Z'
    - type: Ready
      status: 'True'
      lastProbeTime: null
      lastTransitionTime: '2023-10-15T18:20:56Z'
    - type: ContainersReady
      status: 'True'
      lastProbeTime: null
      lastTransitionTime: '2023-10-15T18:20:56Z'
    - type: PodScheduled
      status: 'True'
      lastProbeTime: null
      lastTransitionTime: '2023-10-15T18:20:52Z'
  hostIP: *XXXXXXXX.XX*
  podIP: 10.0.0.140
  podIPs:
    - ip: 10.0.0.140
  startTime: '2023-10-15T18:20:52Z'
  initContainerStatuses:
    - name: init-permissions
      state:
        terminated:
          exitCode: 0
          reason: Completed
          startedAt: '2023-10-15T18:20:54Z'
          finishedAt: '2023-10-15T18:20:54Z'
          containerID: >-
            containerd://b703936cd475add98bad603205406711bc2537142dbb5c920538e546669cba1e
      lastState: {}
      ready: true
      restartCount: 0
      image: >-
        registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-d89a789a
      imageID: >-
        registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper@sha256:e08336dcece82438105f6a24edcb47c46ed2747434868e3bbfbdc237ee48cff9
      containerID: >-
        containerd://b703936cd475add98bad603205406711bc2537142dbb5c920538e546669cba1e
  containerStatuses:
    - name: build
      state:
        running:
          startedAt: '2023-10-15T18:20:55Z'
      lastState: {}
      ready: true
      restartCount: 0
      image: docker.io/library/alpine:latest
      imageID: >-
        docker.io/library/alpine@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978
      containerID: >-
        containerd://d02971adc01fc503f8206ba8f9f231f277f0aaecf931f508b6540370a67ff696
      started: true
    - name: helper
      state:
        running:
          startedAt: '2023-10-15T18:20:55Z'
      lastState: {}
      ready: true
      restartCount: 0
      image: >-
        registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-d89a789a
      imageID: >-
        registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper@sha256:e08336dcece82438105f6a24edcb47c46ed2747434868e3bbfbdc237ee48cff9
      containerID: >-
        containerd://6280d1c5d91c0f5b0a313c4f365d057ac8cd00e33931cee8df9cfe8b74d7ac18
      started: true
  qosClass: BestEffort

Any idea, someone ?
Thanks !!

i get in same issue , @Sid did you managed to resolve it ?
do not hesitate to share your solution , it will be helpful for us .
thank you

Yep ^^ It was related to RBAC.
Please find below my configuration for FluxCD.
You’ll need to adapt it if you want the Helm chart directly, but it’s more or less the same thing.

kind: HelmRelease
metadata:
name: gitlab-runner
spec:
values:
gitlabUrl: https://git.cyberdian.com
runnerToken: “”
runners:
config: |
[[runners]]
executor = “kubernetes”
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.kubernetes]
namespace = “{{.Release.Namespace}}”
service_account = “gitlab-runner”
image = “alpine:latest”
cpus = “8”
rbac:
create: true
rules:
- apiGroups: [““]
resources: [“pods”]
verbs: [“list”, “get”, “watch”, “create”, “delete”]
- apiGroups: [”
”]
resources: [“pods/exec”]
verbs: [“create”]
- apiGroups: [““]
resources: [“pods/log”]
verbs: [“get”]
- apiGroups: [”
”]
resources: [“pods/attach”]
verbs: [“list”, “get”, “create”, “delete”, “update”]
- apiGroups: [““]
resources: [“secrets”]
verbs: [“list”, “get”, “create”, “delete”, “update”]
- apiGroups: [”
”]
resources: [“configmaps”]
verbs: [“list”, “get”, “create”, “delete”, “update”]

securityContext:
  seccompProfile: 
    type: RuntimeDefault