Repository navigation
Description
Problem
devops k8s volume move copies the data through two kubectl exec streams that a named pipe joins (copy_argv, src/devops_cli/k8s/volume_move.py). The data goes from the source node through the API server to the machine of the operator, and back through the API server to the target node. On the homelab, this copy stops for a volume of about 600 MiB.
Evidence of 2026-11-27, kubectl v1.37.3, from the devcontainer:
- A move of a test claim (633,144,478 bytes: one random file of 600 MiB and 2000 small files) from a node without Longhorn to a Longhorn volume on another node. The copy stopped two times, each time about 61 s after its start, with
"Copying stdout failed" err="read message: read tcp <client>-><api-server>:6443: i/o timeout". The move then undid every step, as it must. - A copy by hand of 532 MiB through
kubectl exec ... | kubectl exec -i ...stopped in the same way after about 1 minute (dan-petty/homelab#461). - The same copy command with
KUBECTL_REMOTE_COMMAND_WEBSOCKETS=false(SPDY): all 633,144,478 bytes arrived in/dst, but the pipe did not end within 600 s. - A copy from pod to pod inside the cluster moved 532 MiB in 7 s: the source pod served
tar -con a TCP port with PerlIO::Socket::INET, and the destination pod read it with bash/dev/tcp. Both tools are in the copy imagedebian:trixie-slim(dan-petty/homelab#461).
The 61 s are probably the read deadline of the heartbeat of the WebSocket exec client; a stream that gets no message in that time fails.
Impact
The homelab moves 16 claims to the class longhorn with this command (dan-petty/homelab#399, #7382). Each claim of more than about 1 minute of copy fails, after the workload stopped for that time. The failure is safe (the move undoes its steps), but the moves cannot finish.
Change
Copy from pod to pod inside the cluster, not through the API server. For example: the destination copy pod listens on a TCP port and extracts, and the source copy pod sends tar -c to the IP address of the destination pod. The exec streams then carry only the start and the result. The plan must make sure that the source pod can reach the destination pod (a NetworkPolicy can block it), or the move must refuse.
Acceptance criteria
- A failing test first: the copy step sends no data through
kubectl execstdin or stdout. - A live move of a claim of at least 600 MiB ends with equal digests on the two sides.
devops cichecks pass.
Activity
dan-petty commentedon Nov 27, 2026
Every move over ~600 MiB fails, blocking the 16-claim migration in #7382.Both change the copy step in devops k8s volume move; #3695 fixed a lost tail in the same pipe, the candidate replaces the pipe with pod-to-pod TCP.dan-petty commentedon Nov 27, 2026
One more data point, 2026-11-27 13:35Z: a move of a test claim of 45,941,910 bytes (44 MiB, 2002 files) also lost its first copy with
"Copying stderr failed" err="next reader: read tcp <client>-><api-server>:6443: i/o timeout". The retry passed, and the two sides were equal. So a small claim can fail too, not only a claim that needs more than 61 s.dan-petty commentedon Nov 27, 2026
Which direction fails. Tests of 2026-11-27 13:40Z to 13:47Z, kubectl v1.37.3 from the devcontainer, one temporary pod on a worker node:
sleep 150; echo idle-ok)head -c 734003200 /dev/urandom)websocket: close 1006 (abnormal closure): unexpected EOF, exit 1... | kubectl exec -i ... wc -c)So a long exec stream lives, and stdin carries much data. The stdout of a pod at full speed fails, and that is the source side of the copy. A fix that sends the data from pod to pod, and keeps only an idle exec stream open for the result, avoids the failing direction.
devops-cli-service commentedon Nov 27, 2026
Released in v0.226.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.226.0
devops-cli-service commentedon Nov 27, 2026
Live since 2026-11-27 18:39 UTC