How to copy files between pods or execute in a pod? How to copy files between pods or execute in a pod? kubernetes kubernetes

How to copy files between pods or execute in a pod?


Actually I think your question is that you want to execute the command "cat readme" inside container right?

For this there should be a copy of that file present inside the container

For this you can use hostpath so that to mount the part that contains that file onto the node in a particular directory

you can use this for reference https://kubernetes.io/docs/concepts/storage/volumes/#hostpath

But the problem with this is you have to copy that directory with files present to all the nodes