I want to write some data into volume i.e one of the directory which is residing in this volume, I can exec a pod, but i am not aware how to check the attached volume and write data to it.
I can find the volumes and mount point using:
kubectl describe pods pod-name
You can get the volumes mounted on the pod using the output of kubectl describe pod which has the Mounts section in each container's spec.
An example from the docs:
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-5kdvl (ro)`
You can then exec into the pod using kubectl exec and the cd to the directory you want to write data to.
Another option is to use kubectl copy command and you could read a related answer of mine here.