Bottom Line: Enterprise cloud infrastructure tools, CI/CD runners, and container orchestration runtimes—including Kubernetes containerd, Rancher K3s, Jenkins CI nodes, Terraform providers, and Vagrant VM boxes—consume massive disk space across staging environments. Running this sysadmin playbook reclaims 15 GB to 150 GB+ of storage safely.
The DevOps Infrastructure Storage Crisis
Modern CI/CD pipelines and microservices deployments continuously pull OCI container images, cache provider binaries, and check out git branches. Without explicit garbage collection, worker nodes and developer workstations hit 100% disk usage:
+-------------------------------------------------------------------------+
| [/var/lib/containerd: 80GB] [Jenkins Workspaces: 40GB] [Free: 2GB] |
+-------------------------------------------------------------------------+
^
Critical Cluster Disk Pressure!
Tool-by-Tool Storage Audit & Cleanup Commands
1. Kubernetes containerd Image Storage (/var/lib/containerd) — 20 GB to 100 GB
containerd stores uncompressed OCI container image layers. Prune unused image layers using crictl or nerdctl:
# Prune unused container images in containerd
sudo crictl rmi --prune
# Or using nerdctl
sudo nerdctl system prune -a --volumes -f
2. K3s Lightweight Kubernetes Storage (/var/lib/rancher/k3s) — 10 GB to 40 GB
K3s uses rancher data directories for local cluster execution.
# Prune stale K3s images
sudo k3s crictl rmi --prune
3. Jenkins CI Workspace Directory (var/jenkins_home/workspace) — 10 GB to 50 GB
Jenkins CI nodes store extracted git repositories and build scratch files in job workspaces.
# Delete completed job workspaces older than 7 days
sudo find /var/jenkins_home/workspace -maxdepth 2 -type d -ctime +7 -exec rm -rf {} +
4. Terraform & OpenTofu Provider Plugin Cache (~/.terraform.d/plugin-cache) — 5 GB to 20 GB
Terraform downloads multi-megabyte provider binaries (AWS, Azure, GCP, Helm) for every project directory.
# Clear local Terraform provider plugin cache
rm -rf ~/.terraform.d/plugin-cache/*
5. Vagrant Virtual Machine Box Cache (~/.vagrant.d/boxes) — 10 GB to 50 GB
Vagrant stores base virtual machine images (ubuntu/focal64, debian/bookworm64) locally.
# Prune old unused Vagrant box images
vagrant box prune --force
DevOps Tool Storage Impact Matrix
| Service / Tool | Location | Safety Level | Typical Size Reclaimed |
|---|---|---|---|
| containerd Content | /var/lib/containerd |
✅ 100% Safe | 20 GB – 100 GB via crictl rmi --prune. |
| K3s Storage | /var/lib/rancher/k3s |
✅ 100% Safe | 10 GB – 40 GB via k3s crictl rmi. |
| Jenkins Workspaces | /var/jenkins_home/workspace |
✅ 100% Safe | 10 GB – 50 GB. |
| Terraform Plugins | ~/.terraform.d/plugin-cache |
✅ 100% Safe | 5 GB – 20 GB. |
| Vagrant Boxes | ~/.vagrant.d/boxes |
✅ 100% Safe | 10 GB – 50 GB via vagrant box prune. |
Frequently Asked Questions (FAQ)
Will crictl rmi --prune delete running Kubernetes pod images?
No. crictl rmi --prune only removes unused container images that are not currently associated with an active, running pod container.
Related DevOps Guides
- Learn about containerd Image Layer Storage.
- Learn about K3s Storage Cache.
- Learn about Jenkins Workspace Builds.
Discussion
Loading authentication...