How to copy files from kubernetes Pods to local system

后端 未结 10 1599
暖寄归人
暖寄归人 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

    According to https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands

    kubectl cp is equivalent to using

    kubectl exec -n -- tar cf - | tar xf - -C

    So technically if you do not have tar installed on the pod, you can do kubectl exec -n -- cat >

    Assuming the file is small or already compressed, the effect should be the same, except you cannot use cat on a directory or a set of files.

提交回复
热议问题