将本地文件拷贝到容器内

[root@k8s-master1 ~]# ll
total 16
-rwxr-xr-x. 1 root root  322 Jul  6 09:48 1.sh
-rw-------. 1 root root 1261 Nov 14  2019 anaconda-ks.cfg
drwxr-xr-x. 2 root root   22 Jul  4 09:27 hpa
drwxr-xr-x. 2 root root  227 Jul  2 15:32 metrics-server
-rw-r--r--. 1 root root  375 Jul  4 09:31 my-deploy.yaml
-rw-r--r--. 1 root root  356 Jul  6 09:48 temp
[root@k8s-master1 ~]# kubectl get pod
NAME                   READY   STATUS      RESTARTS   AGE
busybox                0/1     Completed   0          18d
web-5c987b8447-6b6bx   1/1     Running     0          3d20h
web-5c987b8447-jndbj   1/1     Running     0          2d4h
[root@k8s-master1 ~]# kubectl cp ./temp web-5c987b8447-6b6bx:/tmp
[root@k8s-master1 ~]# 

 

[root@k8s-master1 ~]# kubectl exec -it web-5c987b8447-6b6bx sh
# ls /tmp

 

相关文章:

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