kubectl cp from a pod's container
It happens that a pod is defined by two containers
You know this is the case when you "kubectl exec my_pod" into it and displays things like "Defaulted container "sql_container" out of: sql_container, apache_container"
If you want to copy files from a single containered pod, you directly issue
kubectl cp web/my_pod:/var/www/html /root/sources/html
But this will fail on my configuration because when doing like this, it has selected the default container, wchich is the sql_container one!
tar: Removing leading `/' from member names tar: /var/www/html: Cannot stat: No such file or directory tar: Exiting with failure status due to previous errors
Specifiyng the targeted container
If you want to specify the container your target, you have to use the "-c" parameter and specify the container name:
kubectl -c apache_container cp web/my_pod:/var/www/html /root/sources/html