k8s里的cp命令需要tar支持,否则会提示文本结尾EOF出错

[root@master ~]# kubectl cp mysql-2261771434-28hjp:/tmp/ /etc/hosts     
error: unexpected EOF

  

解决方法:进如容器用yum去安装

[root@master ~]# kubectl get pod #先查看容器name
[root@master ~]# kubectl exec -it mysql-2261771434-28hjp /bin/bash
bash-4.2# yum -y install tar
bash-4.2# exit  #退出交互模式

  

 

  

 

相关文章:

  • 2021-05-31
  • 2021-08-07
  • 2022-12-23
  • 2021-11-11
  • 2021-12-23
  • 2021-07-19
猜你喜欢
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-09-19
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案