0

Background:

I've deployed a spring boot app to the openshift platform, and would like to know how to handle persistent storage in OpenShift3. I've subscribed to the free plan and have access to the console. I can use oc command, but access seems limited under my user for commands like 'oc get pv' and others.

Question

How can I get a finer control over my pvc (persistent storage claim) on OS3? Ideally, I want a shell and be able to 'list' file on that volume.

Thanks in advance for your help!

Solution

  1. Add storage to your pod
  2. use the command oc rsh <my-pod> to get access to the pod
  3. cd /path-to-your-storage/

1 Answers1

0

The oc get pv command can only be run by a cluster admin because it shows all the declared persistent volumes available in the cluster as a whole.

All you need to know is that in OpenShift Online starter, you have access to claim one persistent volume. The type of that persistent volume is ReadWriteOnce or RWO.

A persistent volume is not yours until you make a claim and so have a persistent volume claim (pvc) in your project. In order to be able to see what is in the persistent volume, it has to be mounted against a pod, or in other words, in use by an application. You can then get inside of the pod and use normal UNIX commands to look at what is inside the persistent volume.

For more details on persistent volumes, suggest perhaps reading chapter about storage in the free eBook at:

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • Hi Graham, Thank you for your response. – Iqbal AISSAOUI Aug 27 '18 at 12:36
  • Okay, so what I did next is I mounted my storage to a pod, and successfully created a file for testing with java. I use 'oc rsh' to get into the pod, but there's no disk, just the sourcecode? I was expecting something like /dsk0/ Edit:Solved! OK Graham Thanks a lot, my unix command knowledge is rusty... I can see storage inside the pod, I'll update the post! – Iqbal AISSAOUI Aug 27 '18 at 16:18
  • I would also suggest working through https://learn.openshift.com/introduction/transferring-files/ as to how to move files in and out of a container. – Graham Dumpleton Aug 27 '18 at 20:39