Repository navigation
feat(maintenance): prune anonymous volumes no container uses, weekly on prometheus - #1683
Merged
Merged
Conversation
…on prometheus Validation and scratch runs leave anonymous volumes behind: 69 at the 2026-11-13 audit, 99 by 2026-11-23. make prune-images now runs docker volume prune after the image prune. Without --all that removes only com.docker.volume.anonymous volumes, so named volumes survive a stack being down; on an API older than 1.42 the step refuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The daemon-version guard can still allow API requests below 1.42 to prune named volumes, risking retained stack data unless pruning explicitly filters for anonymous volumes.
1 open issue
What changed in this PR
Extends the monitoring host’s weekly image cleanup to reclaim unused anonymous Docker volumes left by validation and scratch runs. Agent-host maintenance remains unchanged.
Changes:
- Adds volume pruning, a server API-version guard, and before/after volume usage reporting.
- Updates service metadata, operational guidance, and the changelog to describe the expanded cleanup.
| File | Description |
|---|---|
systemd/homelab-prune-images.service |
Updates the description and comments to include volume cleanup. |
Makefile |
Adds guarded volume pruning and volume usage reporting. |
docs/runbooks/triage-a-critical-alert.md |
Identifies abandoned anonymous volumes as a disk-usage cause. |
docs/runbooks/schedule-maintenance.md |
Documents agent differences and volume-prune failure cases. |
docs/changelog.md |
Records the cleanup change and unit installation guidance. |
Review effort: Balanced
…olumes # Conflicts: # docs/changelog.md
…API check The daemon's API version does not bound the request's: an old client or DOCKER_API_VERSION=1.41 still sends a pre-1.42 prune, which takes named volumes. Filter on com.docker.volume.anonymous instead; an API 1.41 request with the filter kept a dangling named volume on prometheus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…olumes # Conflicts: # docs/changelog.md
…olumes # Conflicts: # docs/changelog.md
Gerrrt
added a commit
that referenced
this pull request
Nov 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
make prune-images, the weeklyhomelab-prune-imagesjob onprometheus, now also runsdocker volume pruneafter the image prune. Its before-and-after journal lines now report volumes as well as images. The unit's description and comment,schedule-maintenance.md's failure table, the critical-alert disk guidance and the changelog are updated to match. The agent hosts'scripts/prune-images.shis unchanged.Why
The 2026-11-13 audit of
prometheusfound 69 dangling anonymous volumes, left behind by validation and scratch runs. By 2026-11-23 there were 99, and nothing removed them. They were pruned by hand today; this keeps them from building up again.Blast radius
The monitoring host's Docker volumes.
docker volume prune --filter label=com.docker.volume.anonymousremoves only anonymous volumes that no container references, running or stopped. So a named volume (every stack's data) is never removed, even while its stack is down. The filter is explicit because prune's own default depends on the request's API version, and a request below 1.42 would also take named volumes. It runs under thebackupslock, as before.secrets/*.sops.yamlVerification
Probe on
prometheus(Docker 29.9.1, API 1.56): a dangling anonymous volume was removed bydocker volume prune -f, and a dangling named volume survived it.After review: the API-version guard was replaced with the label filter. With
DOCKER_API_VERSION=1.41, the filtered prune removed a dangling anonymous volume and kept a dangling named one.make -n prune-imagesrenders the recipe as intended.python3 scripts/check_docs.py:docs OK../scripts/lint.sh: every check passes. editorconfig first flagged space-indented continuation lines in the Makefile, now tabs.make validate: exit 0, 373 PASS, 5 SKIP. The skips: the tmpfs path refusal (CI covers it), and four checks that need the deployment checkout (unit syntax, installed timers, the sensitive stack's timers, and the homelab-* units' paths). It started on the first commit, and the review fix and the merges ofmainlanded in the worktree while it ran, so it is not a clean run of the final head. Lint, the docs check andsystemd-analyze verifywere re-run on the final head and pass, and CI runs the full set.After merge,
sudo make install-timersonprometheusis needed, because converge does not install units.make validatepasses (5 skipped, listed above)Deployed to the lab and confirmed working
Docs updated (
docs/, service README, ordocs/roadmap.md)🤖 Generated with Claude Code