本地文件转移到Kubernentes持久卷?

时间:2017-11-06 16:31:40

标签: docker file-upload kubernetes google-kubernetes-engine persistent-volumes

我对Kubernetes非常陌生(除了它不是我的领域)但我必须能够执行这种做法。

问题是我需要在容器化的pod中安装Handbrake Converter,并在GKE集群上安装Persistent Volume:

  • 3个节点。
  • node version 1.8.1-gke.1
  • 节点图片Ubuntu

在此之前一切都很好,但现在我无法从本地计算机上传文件夹到该PV。

我尝试过的是与节点的ssh连接,然后是sudo docker exec -ti containerId bash,但我得到了rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused \"exec: \\\"bash\\\": executable file not found in $PATH\"\n"

提前致谢。

1 个答案:

答案 0 :(得分:2)

要将本地文件传输到kubernetes窗格,请使用kubectl cp

kubectl cp my-namepace/my-pod:/root/my-local-file -c my-container ./my-remote-location

对于SSH,您还需要通过kubectl:

kubectl exec -it <podname> -- /bin/sh
相关问题