BlueXIII's Blog

热爱技术,持续学习

0%

KubeSphere中拷贝文件

本机安装kubectl

1
brew install kubectl 

配置kubeconfig

vi ~/.kube/config

1

拷贝文件

https://kubernetes.io/docs/reference/kubectl/cheatsheet/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 查询所有命名空间
kubectl get namespaces

# 查询所有Deployment
kubectl get deployments -n dubhe-test

# 查询Pods
kubectl get pods -n dubhe-test | grep dubhe-metadata-deploy

# 进入容器
kubectl exec -it -n dubhe-test dubhe-metadata-deploy-758df87bfd-wqhs2 -- /bin/bash

# 得到容器内日志路径
cd /dubhe-metadata-biz/logs

# 拷贝目录到本机
kubectl cp -n dubhe-test dubhe-metadata-deploy-758df87bfd-wqhs2:/dubhe-metadata-biz/logs ./