Safe to Delete

The Cloud & DevOps Storage Playbook: Kubernetes containerd, K3s & Jenkins

Quick Answer: The ultimate 1,200-word field guide for DevOps engineers and cluster admins to reclaim 150GB+ from Kubernetes containerd layers, K3s storage, Jenkins workspaces, and Terraform caches.

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.


Discussion

Loading authentication...

Related in developer

The AI Engineer's Model Disk Cleanup Guide: Hugging Face, Ollama & PyTorch

The ultimate 1,200-word field guide for AI developers and local LLM hobbyists to reclaim 200GB+ from Ollama, Hugging Face, PyTorch, and vLLM model weights.

Safe to Delete

Android Studio System Index Cache (AndroidStudio Cache)

Android Studio caches Gradle project indexes, VFS caches, and compiler artifacts. Invalidate and clear is safe.

Safe to Delete

Ansible Automation Temp & Fact Cache (~/.ansible/tmp)

Ansible stores temporary playbook execution modules and target host fact JSON caches in ~/.ansible/tmp. Clearing Ansible tmp is safe.

Safe to Delete
Back to all files