I'm using kubectl cp to copy a jar file from my local file system into a the home directory of a POD in my minikube environment. However, the only way I can confirm that the copy succeeded is to issue a new kubectl cp command to copy the file back to a temp directory and compare the checksums. Is there a way to view the copied files directly?
You can execute commands in a container using kubectl exec
command.
For example:
to check files in any folder:
kubectl exec <pod_name> -- ls -la /
or to calculate md5sum
of any file:
kubectl exec <pod_name> -- md5sum /some_file