Repository navigation
Description
Problem
devops k8s volume-move copies the data of a claim with its own code. It runs tar over a pod socket, and it compares digests with its own Bash.
The code (lines at commit d0bc3dffa; #7490 and #7491 changed the file after it):
src/devops_cli/k8s/volume_move.pyhas 1,889 lines.:369-412: the tar copy over a pod socket.:339-352and:1023-1048: the digest compare.:295-307: the Argo CD pause patch.:315-327: theclaimRefrebind.:1064-1462: the undo in_MoveRun.:1478-1889: the dry-run plan.
volume_move_measure.pyhas 561 lines.config/constants.py:4924-4980holds the Bash bodies of the copy pods.- In all: 2,450 lines of Python and 79 tests.
The command moves data, so each bug can lose data. In 30 days:
- Issues: fix(k8s): volume move loses the end of its copy #3695, fix(k8s): volume move cannot copy a claim off a cordoned node #5305, fix(k8s): patch bound Delete volumes and recreate StatefulSets #6752, fix(k8s): copy volume move data pod to pod, not via API server #7408, fix(k8s): leave lost+found out of the volume move compare #7414, fix(k8s): delete the new volume when a volume move undoes #7416, fix(k8s): skip ended pods in the volume move plan #7431, fix(k8s): volume move copy pods fail Pod Security restricted #7449 (open), fix(k8s): refuse a volume move in a restricted namespace #7451 (open), fix(k8s): delete a move volume bound after the undo #7452 (open), fix(k8s): wait for running Argo CD syncs in a volume move #7464, fix(k8s): delete ended pods before the old claim in volume move #7465, fix(k8s): end a retrying Argo CD sync in volume move #7485 (open), fix(k8s): refuse a volume move under an ApplicationSet #7486 (open).
- Fix PRs: fix(k8s): leave lost+found out of the volume move compare #7415, fix(k8s): copy volume move data pod to pod, not via API server #7417, fix(k8s): delete the new volume when a volume move undoes #7429, fix(k8s): skip ended pods in the volume move plan #7433, fix(k8s): delete ended pods before the old claim in volume move #7468, fix(k8s): wait for running Argo CD syncs in a volume move #7469, fix(k8s): end a retrying Argo CD sync in volume move #7490.
- About 5 of the 14 bugs are in the copy and the compare: fix(k8s): volume move loses the end of its copy #3695, fix(k8s): volume move cannot copy a claim off a cordoned node #5305, fix(k8s): copy volume move data pod to pod, not via API server #7408, fix(k8s): leave lost+found out of the volume move compare #7414 and fix(k8s): volume move copy pods fail Pod Security restricted #7449.
Change
Replace the copy and the compare with pv-migrate.
- Tool: pv-migrate (https://github.com/utkuozdemir/pv-migrate), Apache-2.0, v3.8.0 (2026-11-15). The repository is active.
- pv-migrate copies one claim to another claim with rsync. It works across nodes, namespaces and storage classes. Its chart exposes
securityContextvalues.
Move to the tool:
- The tar copy, the copy pods and their Bash bodies.
- The digest compare. rsync checks each file that it sends.
Keep, because pv-migrate does not do these steps:
- The Argo CD pause, the sync waits and the ApplicationSet refusal.
- The scale-down and the undo.
- The
claimRefrebind. If the new claim name goes to git in place of the rebind, the Argo CD pause is no longer necessary. Decide this in the plan.
Delete:
- The tar copy, the digest compare and the copy Bash bodies in
config/constants.py. - The parts of
volume_move_measure.pythat only the custom copy uses.
Longhorn is the second path. It is already deployed in dan-petty/homelab (k8s/argocd/apps/longhorn.yaml). A Longhorn volume is not bound to a node, so it never needs a move. The plan lists the claims that can live on Longhorn. Those claims move to Longhorn one time, and the command no longer handles them.
Risk: the pv-migrate pods may fail Pod Security restricted, as the current copy pods do (#7449, #7451). Test this first in a restricted namespace, and set the securityContext values of the chart.
Existing tool considered
- pv-migrate (Apache-2.0, v3.8.0). It does the copy only. It does not pause Argo CD, scale the workload down or undo a failed move.
- Longhorn (deployed). It removes the need to move a claim between nodes. It does not help a claim that must stay on local-path.
- Velero (Apache-2.0, v1.19.0, 2026-11-23). It can back up and restore with a changed storage class. It is more than a copy of one claim needs.
- VolSync is not an option, because it is AGPL-3.0.
Done when
- The custom tar copy, the copy Bash bodies and the custom digest compare are deleted.
devops k8s volume-movecalls pv-migrate for the copy.- A test proves that the command builds the pv-migrate call with the source claim, the target claim and the
securityContextvalues. - One live move of a test claim in a
restrictednamespace passes, and the data on the new claim matches the source. - The plan lists the claims that can move to Longhorn.
Activity
feat(image): add pv-migrate (#119)
devops-cli-service commentedon Nov 28, 2026
Released in v0.232.3: https://github.com/dan-petty/devops-cli/releases/tag/v0.232.3
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 05:01 UTC