このコンテンツは選択した言語では利用できません。

Chapter 3. Configuring self-hosted GitLab runner requirements


If you use a self-hosted GitLab instance or self-hosted GitLab runners on OpenShift with Red Hat Advanced Developer Suite - software supply chain, you might encounter failures. The following procedures outline adjustments you might need to make.

  • Security Context Constraint (SCC): This is required only if you use your own GitLab runners on OpenShift. This applies whether you are using a self-hosted GitLab instance or gitlab.com.
  • Maximum Artifact Size: This is required only if you use a self-hosted GitLab instance

Prerequisites

  • You have administrative access to your self-hosted GitLab instance.
  • You have cluster-admin access to the OpenShift cluster where your runners will start their jobs.
  • You have installed the OpenShift CLI (oc).

Procedure

  1. If you use self-hosted runners on OpenShift, set the required security context for the GitLab runners by applying a custom Security Context Constraint (SCC).

    1. Create a YAML file, for example gitlab-ci-scc.yml, with the following sample content.

      apiVersion: security.openshift.io/v1
      kind: SecurityContextConstraints
      metadata:
        name: gitlab-ci-sa-scc
        namespace: gitlab-runner
      allowHostPorts: false
      allowPrivilegeEscalation: true
      allowPrivilegedContainer: true
      allowedCapabilities:
        - SETFCAP
        - MKNOD
      defaultAddCapabilities: null
      fsGroup:
        type: RunAsAny
      priority: 5
      readOnlyRootFilesystem: false
      requiredDropCapabilities:
        - KILL
      runAsUser:
        type: MustRunAs
        uid: 0
      seLinuxContext:
        type: RunAsAny
      supplementalGroups:
        type: RunAsAny
      users:
        - system:serviceaccount:gitlab-runner:gitlab-ci-sa
      volumes:
        - configMap
        - downwardAPI
        - emptyDir
        - persistentVolumeClaim
        - projected
        - secret
      Copy to Clipboard Toggle word wrap
      Note

      This manifest is a sample. You might need to adjust settings, such as the namespace in the users field, for your environment.

    2. Apply the manifest to your cluster.

      $ oc apply -f gitlab-ci-sa-scc.yml
      Copy to Clipboard Toggle word wrap
  2. If you use a self-hosted GitLab instance, increase the maximum artifact size to prevent pipeline failures. The default 100 MB limit is often insufficient. Increase the limit to at least 1 GB (1024 MB) by following the official GitLab documentation.

Verification

  • Verify that the Security Context Constraint has been created.

    $ oc get scc gitlab-ci-sa-scc
    Copy to Clipboard Toggle word wrap

    The command should return the name of the SCC.

  • After running a pipeline, confirm that it no longer fails due to security context or artifact size errors.

Revised on 2026-02-04 23:23:45 UTC

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る