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 use the event command of kubectl . To see what fields are possible you can use kubectl describe on any event.
To view the entire configuration of the pod, just run kubectl describe pod nginx in your terminal. The terminal will now display the YAML for the pod, starting with the name nginx, its location, the Minikube node, start time and current status.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With