将主机上的文件拷贝到pod的容器中
官网文档
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#cp
例如将主机上的index.html文件拷贝到pod容器中替换nginx首页显示
kubectl cp ./index.html -n test test-pod:/usr/share/nginx/html/
将pod容器中的index.html文件拷贝到主机目录上
kubectl cp nginx-pod:usr/share/nginx/html/index.html -n test /usr/local/resourece_yaml/index.html
本文来自博客园,作者:弩哥++,转载请注明原文链接:https://www.cnblogs.com/bangbangzoutianya/p/16835673.html

浙公网安备 33010602011771号