I am getting Error: unknown shorthand flag: 'R' in -R error when I run the line below. I'm aware of the root cause. It is -R. How can I run this command without issue?
kubectl -n $NAMESPACE -c vault cp -R /source /destination
P.S.: withour -R, I can run the command, but I want to copy the directories. Any help would be appreciated it. Thanks
As Barmar said, this option doesn't exist on kubectl cp
If you want to copy a directory into the container use the command below:
kubectl cp /home/local-dir <pod-name>:/tmp/container-dir
To copy the directory to a specific container into the pod use:
kubectl cp /home/local-dir <pod-name>:/tmp/container-dir -c container-name