linode: tag every LKE volume at birth via StorageClass volumeTags - #1311
Conversation
Root-cause fix for the residual volume leak behind #1287/#1296. Every PMM HA PVC uses LKE's default StorageClass linode-block-storage-retain, which has no volumeTags and (being Retain) keeps its backing Block Storage volume after the cluster is gone. Its parameters are immutable, so volumes were born untagged and left unattributable -- prune-lke-orphans.sh (positive attribution) can never reap an untagged volume, so any volume unattached at teardown or created after the provision-time tagging pass leaked permanently. create-lke now recreates that StorageClass (same name, so it covers PVCs that reference it explicitly or as default) with linodebs.csi.linode.com/volumeTags: pmm-qa-ephemeral,pmm-qa-run:<id>, so the CSI driver stamps the run tag on every volume at creation -- attached or not, at provision or later. Verified on a live LKE cluster: a PVC created against a volumeTags StorageClass produced a Linode volume already carrying both tags. The EXIT-trap and pre-delete tag-lke-resources.sh stay as a backstop for the brief window before the SC applies (and if LKE re-reconciles the SC). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DBhvZuEUQU8ym347Xat4Yy
|
Warning Review limit reachedNext included review available in 16 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No review reference covers |
…a.sh Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Problem
Root-cause fix for the residual volume leak behind #1287/#1296. Auditing the live account after #1296 shipped still turned up dozens of orphaned
pvc-*Block Storage volumes the sweep could not reap — all untagged.Cause, confirmed on a live LKE cluster:
linode-block-storage-retain, whose reclaim policy is Retain — so its backing Block Storage volume is kept when the PVC/cluster is deleted.volumeTags, and a StorageClass's parameters are immutable, so volumes are born untagged.prune-lke-orphans.shdeletes by positive attribution (apmm-qa-run:tag whose run has no live cluster). It can never reap an untagged volume — by design, to avoid deleting live/other-owner data. So any volume that was unattached at teardown, or created after the provision-time tagging pass, or belonged to a cluster not torn down via our scripts, leaked permanently.The imperative tagging added in #1287/#1296 (
tag-lke-resources.shat provision and before delete) only tags volumes attached at those moments, so it structurally cannot cover the unattached/late cases.Change
create-lke-pmm-ha.shnow, before installing any chart, recreates the cluster's default StorageClass (same namelinode-block-storage-retain, so it covers PVCs that reference it explicitly or inherit it as default) with:The Linode CSI driver then stamps the run tag on every volume at creation — attached or not, at provision or later — so 100% of the cluster's volumes are attributable and the sweep reaps them reliably. Reclaim policy is left
Retain(no behavior change beyond attribution); the EXIT-trap and pre-deletetag-lke-resources.shremain as a backstop for the brief window before the StorageClass applies (and if LKE re-reconciles the SC).SKILL.mdupdated to describe tag-at-birth as the primary volume-attribution mechanism.Validation
shellcheck -S warningandbash -nclean oncreate-lke-pmm-ha.sh.linodebs.csi.linode.com/volumeTags; the resulting Linode volume came back from the API already tagged["pmm-qa-ephemeral","pmm-qa-run:sctest"], and withDeletereclaim the volume was removed when the PVC was deleted.🤖 Generated with Claude Code
https://claude.ai/code/session_01DBhvZuEUQU8ym347Xat4Yy
Generated by Claude Code