kubectl -- cp

简介: kubectl -- cp 将文件和目录复制到容器和从容器复制文件和目录。

将/tmp/foo_dir本地目录复制到默认命名空间中远程pod中的/tmp/bar_dir
kubectl cp /tmp/foo_dir :/tmp/bar_dir


将/tmp/foo本地文件复制到特定容器中远程pod中的/tmp/bar,-C指向特定容器
kubectl cp /tmp/foo :/tmp/bar -c


将/tmp/foo本地文件复制到命名空间中远程pod中的/tmp/bar
kubectl cp /tmp/foo /:/tmp/bar


将/tmp/foo从远程pod复制到本地/tmp/bar
kubectl cp /:/tmp/foo /tmp/bar

目录
打赏
0
0
0
0
3
分享
相关文章
Failed at step CHDIR spawning /opt/kubernetes/bin/etcd: No such file or directory
Failed at step CHDIR spawning /opt/kubernetes/bin/etcd: No such file or directory
99 0
Nginx里的root和alias的区别是什么?
Nginx里的root和alias的区别是什么?
369 2
kubectl exec -it etcd-master -n kube-system /bin/bashkubectl exec [POD] [COMMAND]
kubectl exec -it etcd-master -n kube-system /bin/bashkubectl exec [POD] [COMMAND]
62 0
etcdctl 3.2版本执行 /opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem出错
etcdctl 3.2版本执行 /opt/etcd/bin/etcdctl --cacert=/opt/etcd/ssl/ca.pem出错
165 0
run nginx报错,解决方式 Are you trying to mount a directory onto a file
run nginx报错,解决方式 Are you trying to mount a directory onto a file
336 0
Docker - 解决创建 nginx 容器尝试挂载 nginx.conf 文件时报错: mounting "/root/nginx.conf" to rootfs at "/etc/nginx/nginx.conf" caused: mount through procfd: not a directory:
Docker - 解决创建 nginx 容器尝试挂载 nginx.conf 文件时报错: mounting "/root/nginx.conf" to rootfs at "/etc/nginx/nginx.conf" caused: mount through procfd: not a directory:
3241 0
Kubectl cp使用注意事项
pod内到本地针对 此命令有限制

热门文章

最新文章