kubernetes 是否可以修复kubectl文件复制问题

mznpcxlj  于 2023-10-17  发布在  Kubernetes
关注(0)|答案(1)|浏览(105)

我想从kubernetes pod复制文件到本地机器,但显示类似tihs的错误:

> kubectl cp texhub-server-service-6f8d688c77-kvhgg:"/app/core.21" /Users/xiaoqiangjiang/core.21
tar: removing leading '/' from member names
Dropping out copy after 0 retries
error: unexpected EOF

为什么会发生这样的事呢?我该怎么做才能解决这个问题?我已经尝试添加了retries参数,仍然面临这个问题:

> kubectl cp texhub-server-service-6f8d688c77-kvhgg:"/app/core.21" /Users/xiaoqiangjiang/core.21 --retries=3
tar: removing leading '/' from member names
Resuming copy at 888832 bytes, retry 0/3
tar: removing leading '/' from member names
Resuming copy at 1505280 bytes, retry 1/3
tar: removing leading '/' from member names
Resuming copy at 2125824 bytes, retry 2/3
tar: removing leading '/' from member names
Dropping out copy after 3 retries
error: unexpected EOF

这是pod列表:

> kubectl get pods
NAME                                     READY   STATUS    RESTARTS         AGE
admin-service-54f5d4b568-vbjg6           1/1     Running   345 (5m1s ago)   6d18h
ai-web-594648499d-hq8gx                  1/1     Running   0                58d
chat-server-service-686b4d59f7-x2tq2     2/2     Running   0                24d
cruise-web-74cc96797f-l7g55              1/1     Running   0                68d
cv-render-service-5489d5949c-f6stg       1/1     Running   1 (2d18h ago)    2d18h
cv-service-56cd946c4c-8p4t8              1/1     Running   0                29d
cv-web-647cbccd95-47w7d                  1/1     Running   0                29d
dolphin-music-service-597988cd59-bd92w   1/1     Running   2 (19d ago)      129d
dolphin-post-service-79df79d7f7-zww7x    1/1     Running   0                6d18h
official-website-776b6c6dfd-hfbcx        1/1     Running   0                407d
react-admin-new-6ff54c9889-9cwrf         1/1     Running   0                7d21h
rss-sync-service-77dd845898-wqhp2        1/1     Running   27 (31h ago)     8d
snap-web-66dbcc769f-sl6bs                1/1     Running   0                139d
texhub-server-service-6f8d688c77-kvhgg   1/1     Running   3 (20m ago)      30m
texhub-web-f9fd456f7-47ccc               1/1     Running   0                42h
tool-web-7f97bf5484-28j7r                1/1     Running   0                141d
y-websocket-service-768d56f54b-845kf     1/1     Running   12 (3d19h ago)   6d18h

Core.21文件大小为8Mb。

qv7cva1a

qv7cva1a1#

看看这两种选择是否对你有帮助

kubectl cp texhub-server-service-6f8d688c77-kvhgg:"/app/core.21" /Users/xiaoqiangjiang/core.21 --retries=-1

retries=-1(任意负值表示无限重试)

kubectl exec texhub-server-service-6f8d688c77-kvhgg cat /app/core.21 > /Users/xiaoqiangjiang/core.21

相关问题