Skip to content

fix(k8s): copy volume move data pod to pod, not via API server - #7417

Merged
dan-petty merged 3 commits into
mainfrom
fix/7408-volume-move-pod-to-pod-copy
Nov 27, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/7408-volume-move-pod-to-pod-copy

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops k8s volume move copies the data from pod to pod over the pod network. Through the API server, the stdout of an exec stream lost data at full speed and stopped with i/o timeout, so the old pipe of two exec streams failed for claims of a few hundred MiB.

The copy script reads the IP address of <claim>-dst, starts a one-time listener there (Perl, port 7373) that gives one connection to tar -x, makes <claim>-src send tar -c to it with bash /dev/tcp, and waits for the exit code of the extract. Each exec stream carries only a script and its result.

The move makes the NetworkPolicy <claim>-copy, which lets the copy pods reach each other on port 7373 only, so a namespace that refuses traffic by default still lets the copy pass. The move and its undo delete it, and the plan refuses it as a leftover.

Closes #7408

Change: openspec/changes/archive/2026-11-27-7408-volume-move-pod-to-pod-copy/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 27, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Live checks on the homelab, 2026-11-27, kubectl v1.37.3 from the devcontainer.

Check Result
main: move of 633 MB to another node copy stopped 2 times after about 61 s (i/o timeout), move undone (#7408)
Exec stream, 700 MiB down from a pod failed after 13 s, 3,985,413 bytes short, websocket: close 1006
Exec stream, 700 MiB up into a pod; idle 150 s; one line each second for 150 s all passed
Prototype of this copy script, 738,097,746 bytes from local-path on <gpu-node> to a new longhorn volume on <storage-node> 7 s, content digest equal
This branch: full move of a claim of 737,979,517 bytes (600 MiB random file, 2000 small files, a symlink, a sparse file of 100 MiB, owner 1000:1000) from local-path on <gpu-node> to local-path on <storage-node> (--to-node), in a namespace with a NetworkPolicy that selects every pod and allows no ingress and no egress first copy passed, The two sides are equal: 2005 entries, 2003 files, 737979509 bytes; whole move 22 s; pod Running on the target node; sha256sum of all files the same; owner kept; sparse file still 0 blocks; <claim>-copy deleted, the deny policy kept
Deny policy enforced? a pod without the copy labels got Connection refused from a pod that listened on port 7373 (kube-router rejects); a local connect in that pod passed

The test namespaces and their volumes are deleted. A move to longhorn needs #7415 too: before it, the compare counts the lost+found of the new ext4 volume.

@devops-cli-service

Copy link
Copy Markdown
Contributor

Pull request #7417 has merge conflicts with main at commit 5a8976e07023. GitHub cannot merge it. Rebase the branch onto the current main, resolve the conflicts and push the branch.

@dan-petty
dan-petty marked this pull request as ready for review November 27, 2026 14:19
@dan-petty
dan-petty force-pushed the fix/7408-volume-move-pod-to-pod-copy branch from 5a8976e to aa7d7c7 Compare November 27, 2026 14:21
@dan-petty
dan-petty merged commit 3a448e3 into main Nov 27, 2026
28 checks passed
@dan-petty
dan-petty deleted the fix/7408-volume-move-pod-to-pod-copy branch November 27, 2026 14:56
dan-petty-release Bot added a commit that referenced this pull request Nov 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.226.0](v0.225.1...v0.226.0)
(2026-11-27)


### Features

* **roadmap:** Add the OpenSpec row to the onboard command
([#7407](#7407))
([1d80f4d](1d80f4d))


### Bug Fixes

* **deps:** update dan-petty/devtools Docker tag to v1.3.3
([#7420](#7420))
([d6fc228](d6fc228))
* **k8s:** copy volume move data pod to pod, not via API server
([#7417](#7417))
([3a448e3](3a448e3))
* **k8s:** run rag-ingest on Argo Workflows v4
([#7421](#7421))
([28036a8](28036a8))

---
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/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): copy volume move data pod to pod, not via API server

1 participant