Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for GitLab
  • Getting started
    • All guides
    • Getting information about instances
    • Creating and activating an instance
    • Configuring security groups
    • Stopping and starting an instance
    • Updating instance settings
    • Managing backups
    • Migrating from a custom GitLab installation
    • Migrating to a different availability zone
    • Cleaning up full disk space
    • Deleting an instance
    • Creating and adding users to a project
    • Setting up approval rules
    • Instance state monitoring
    • Setting up OmniAuth
    • Integration with Object Storage
    • Working with a managed runner
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Clean up the instance disk space
  • Delete obsolete pipelines
  • Configure disk space cleanup policies
  1. Step-by-step guides
  2. Cleaning up full disk space

Cleaning up full instance disk space

Written by
Yandex Cloud
Updated at May 6, 2026
  • Clean up the instance disk space
  • Delete obsolete pipelines
  • Configure disk space cleanup policies

A GitLab instance can run out of disk space. This is indicated by the 500 Internal Server Error HTTP status code. In this case, you will not be able to sign in to the GitLab instance.

You can increase the instance disk space on your own.

To prevent disk space from filling up in the future:

  • Regularly clean up the instance disk space manually.
  • Periodically delete irrelevant pipelines.
  • Configure disk space cleanup policies.

You can also set up alerts for the Data disk chart in Monitoring.

Clean up the instance disk spaceClean up the instance disk space

  1. Manually review all Docker images and their tags in GitLab Container Registry.
  2. Delete obsolete images and tags.

Delete obsolete pipelinesDelete obsolete pipelines

Pipelines create jobs, which in turn generate logs. The longer and more actively you use a GitLab instance, the more disk space you need to store logs. To free up space, you can delete irrelevant pipelines, thus also deleting jobs with their logs.

In the GitLab web UI, you can only delete one pipeline at a time. To bulk delete irrelevant pipelines and their logs, use the following script:

Warning

Once you run it, the script will immediately permanently bulk delete the pipelines and all associated data, such as jobs, logs, artifacts, and triggers. You cannot undo this action.

Note

For the script to work correctly, download and install jq.

#!/bin/sh
set -e

TOKEN=<your_token>
PER_PAGE=<number_of_pipelines_to_delete>
UPDATED_BEFORE=<date_of_last_update>
GITLAB_URL=<GitLab_instance_FQDN>

for PROJECT in $(curl -sL --header "PRIVATE-TOKEN: $TOKEN" "$GITLAB_URL/api/v4/projects?per_page=$PER_PAGE" | jq '.[].id') ; do
  echo "Deleting in project $PROJECT"
  for PIPELINE in $(curl -sL --header "PRIVATE-TOKEN: $TOKEN" "$GITLAB_URL/api/v4/projects/$PROJECT/pipelines?per_page=$PER_PAGE&sort=asc&updated_before=${UPDATED_BEFORE}T00:00:00Z" | jq '.[].id') ; do
      echo "Deleting pipeline $PIPELINE"
      curl -L --header "PRIVATE-TOKEN: $TOKEN" --request "DELETE" "$GITLAB_URL/api/v4/projects/$PROJECT/pipelines/$PIPELINE"
  done
done

Where:

  • TOKEN: GitLab token of the user with the Owner role in the project.
  • PER_PAGE: Number of pipelines to delete per request. You can delete a maximum of 100 pipelines at a time. If you have more, you will need to run the script several times.
  • UPDATED_BEFORE: Upper limit of the update date in YYYY-MM-DD format. The script will delete all pipelines updated prior to this date.
  • GITLAB_URL: GitLab instance FQDN.

Configure disk space cleanup policiesConfigure disk space cleanup policies

You can use any of the following options:

  • Set the expiration time for build artifacts at the instance level. By default, it is 30 days.
  • Create and enable a tag cleanup policy for individual projects using GitLab Container Registry.
  • If you are using the Yandex Container Registry integration, set up a Docker image cleanup policy within Yandex Container Registry.

Was the article helpful?

Previous
Migrating to a different availability zone
Next
Deleting an instance
© 2026 Direct Cursus Technology L.L.C.