[root@UR-20210425NAMA var]# kubectl cp kubesphere-devops-system/maven-9bm60:/home/jenkins/agent/workspace/erver-pipeline_feature_pipel
ine2/target/scp-gateway-server-1.0-SNAPSHOT.jar scp-gateway-server-1.0-SNAPSHOT.jar
Defaulting container name to jnlp.
tar: Removing leading `/' from member names
[root@UR-20210425NAMA var]# ls
adm crash empty gopher kerberos local log named opt run spool yp
cache db games home lib lock mail nis preserve scp-gateway-server-1.0-SNAPSHOT.jar tmp
拷贝容器内的文件到本地:
kubectl cp default/venus-registry-web-8cd94fc99-fws4b:demo.txt demo.txt
拷贝本地文件到容器内:
kubectl cp demo.txt default/venus-registry-web-8cd94fc99-fws4b:demo.txt
查看容器奔溃之前的日志:
kubectl logs --previous
kubectl cp 命名空间/容器名:/容器目录/文件名 /宿主机目录/文件名