How to copy files from kubernetes Pods to local system

后端 未结 10 1632
暖寄归人
暖寄归人 2020-12-24 10:22

I\'m trying to copy files from Kubernetes Pods to my local system. I am getting the below error while running following command:

kubectl cp aks-ssh2-6cd4948         


        
10条回答
  •  别那么骄傲
    2020-12-24 11:04

    On my side the issue was with having multiple containers inside the pod:

    kubectl cp -c grafana \
        metrics/grafana-5c4f76b49b-p88lc:/etc/grafana \
        ./grafana/etc
    

    so set the container name with -c grafana and properly prefix the namespace of the pod in my case metrics/

提交回复
热议问题