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
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/
-c grafana
metrics/