Skip to content

feat(k8s): move a claim to another storage class with volume move - #7409

Merged
dan-petty merged 4 commits into
mainfrom
feat/7382-volume-move-storage-class
Nov 27, 2026
Merged

dan-petty merged 4 commits into
mainfrom
feat/7382-volume-move-storage-class

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops k8s volume move NAMESPACE/CLAIM --storage-class CLASS copies a claim to a new volume of another StorageClass and binds the claim name to it. A claim cannot change its class, so this moves a claim that keeps its name, such as one of volumeClaimTemplates, from local-path to longhorn.

The target node must attach the class: when a CSIDriver has the name of the provisioner, only nodes whose CSINode lists it. Without --to-node, the plan picks the one with the most free disk; the node of the old volume can be it. The plan refuses an unknown class and a --to-node without the driver. After the start, the pods must run, on any node.

--plan prints the old and the target class. The k8s README covers the claim size, the git order and a StatefulSet template.

Closes #7382

Change: openspec/changes/archive/2026-11-27-7382-volume-move-storage-class/

@dan-petty dan-petty added type/feature Type feature: a new function scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 27, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Live check on the homelab, 2026-11-27, with the branch build (uv run devops in the worktree).

Set-up: a test Deployment with a local-path claim of 2Gi on <gpu-node>, a node without the Longhorn driver. Then a change like the git change of a real move: the pod template gets the required node affinity node.longhorn.io/create-default-disk In [true], so the new pod waits Pending and the old pod runs.

Check Result
--plan --storage-class longhorn Target <storage-node-1> (the most free disk of the 3 nodes whose CSINode lists driver.longhorn.io), Target class: longhorn; it found the Running and the Pending pod
Move of 44 MiB (2002 files) Done in 120 s. The first copy stopped with i/o timeout, the retry passed; 2004 entries, 2002 files, 45941910 bytes, equal digests
Claim after the move storageClassName: longhorn, Bound to the new volume (driver.longhorn.io, Retain); Longhorn volume attached healthy, 2 replicas
Pod after the move Running on <storage-node-2>, not on the copy node: the scheduler selected it
Data sha256sum of all files the same before and after; owner 1000:1000 and mode 600 kept; symlink kept
Argo CD The test claim has no Application, so the move paused and resumed none
Move of 600 MiB The copy stopped two times after about 61 s (i/o timeout on the exec stream), and the move undid each step. This is the copy path, not the class change: #7408

The test namespace and its two volumes are deleted.

@dan-petty
dan-petty marked this pull request as ready for review November 27, 2026 13:47
@dan-petty
dan-petty merged commit 19bb409 into main Nov 27, 2026
28 checks passed
@dan-petty
dan-petty deleted the feat/7382-volume-move-storage-class branch November 27, 2026 13:51
dan-petty-release Bot added a commit that referenced this pull request Nov 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.225.0](v0.224.3...v0.225.0)
(2026-11-27)


### Features

* **k8s:** move a claim to another storage class with volume move
([#7409](#7409))
([19bb409](19bb409))


### Bug Fixes

* **k8s:** run infra-drift on Argo v4 with API server egress
([#7410](#7410))
([6546f84](6546f84))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(k8s): move a claim to another storage class with volume move

1 participant