OnCallReady

Commands

kubectl cp - Copy files and directories to and from containers

kubectl cp <file-spec-src> <file-spec-dest> [-c CONTAINER]
  file-spec: [[namespace/]pod:]file/path

Options you will use

-c, --container=NAME
the container (default: the first one, or the kubectl.kubernetes.io/default-container annotation)
--no-preserve
do not keep ownership and permissions on the copy in the container
--retries=N
retry a broken transfer from the pod N times

Examples

$ kubectl cp dev/api-7d9f:/var/log/app.log ./app.log

pod -> local: give the destination a FILE name

$ kubectl cp ./fix.conf dev/api-7d9f:/tmp/fix.conf -c api

local -> pod, one container of several

$ kubectl exec api-7d9f -- cat /etc/app/app.yaml > app.yaml

the fallback when cp cannot work (symlinks, no tar)

Gotchas

Try kubectl cp in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.