GitLab CI/CD instance configuration

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab Self-Managed

GitLab administrators can manage the GitLab CI/CD configuration for their instance.

Disable GitLab CI/CD in new projects

GitLab CI/CD is enabled by default in all new projects on an instance. You can set CI/CD to be disabled by default in new projects by modifying the settings in:

  • gitlab.yml for self-compiled installations.
  • gitlab.rb for Linux package installations.

Existing projects that already had CI/CD enabled are unchanged. Also, this setting only changes the project default, so project owners can still enable CI/CD in the project settings.

For self-compiled installations:

  1. Open gitlab.yml with your editor and set builds to false:

    ## Default project features settings
    default_projects_features:
      issues: true
      merge_requests: true
      wiki: true
      snippets: false
      builds: false
  2. Save the gitlab.yml file.

  3. Restart GitLab:

    sudo service gitlab restart

For Linux package installations:

  1. Edit /etc/gitlab/gitlab.rb and add this line:

    gitlab_rails['gitlab_default_projects_features_builds'] = false
  2. Save the /etc/gitlab/gitlab.rb file.

  3. Reconfigure GitLab:

    sudo gitlab-ctl reconfigure

Disaster recovery

You can disable some important but computationally expensive parts of the application to relieve stress on the database during ongoing downtime.

Disable fair scheduling on instance runners

When clearing a large backlog of jobs, you can temporarily enable the ci_queueing_disaster_recovery_disable_fair_scheduling feature flag. This flag disables fair scheduling on instance runners, which reduces system resource usage on the jobs/request endpoint.

When enabled, jobs are processed in the order they were put in the system, instead of balanced across many projects.

Disable compute quota enforcement

To disable the enforcement of compute minutes quotas on instance runners, you can temporarily enable the ci_queueing_disaster_recovery_disable_quota feature flag. This flag reduces system resource usage on the jobs/request endpoint.

When enabled, jobs created in the last hour can run in projects which are out of quota. Earlier jobs are already canceled by a periodic background worker (StuckCiJobsWorker).