Q: Cant copy files from minikube I have setup a kubernetes cluster locally using minikube and want to copy a file from the minikube to my local machine.
I am able to ssh into minikube successfully and run command but the scp command is timing out.
Commands followed
scp -i $(minikube ssh-key) docker@$(minikube ip):/home/docker/.docker/config.json ~/.docker/newconfig.json

and I am getting the following error message
ssh: connect to host 192.168.49.2 port 22: Operation timed out

Has anyone encountered this issue before or knows how to fix it?

A: Use 'KUBECTL CP' to Copy the files and directories from a Kubernetes Container [POD] to the local host and vice versa.

Copy /tmp/foo from a remote pod to /tmp/bar locally

kubectl cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar

