Creating new app in Openshift 3 and moving from OS2

9/21/2017

I deployed a telegram bot written in Node.js on Openshift 2 over a year ago. I received the notice about the OS 2 to OS 3 migration and then I started to read some things about OS 3, like the book ("Openshift for developers"), I read the documentation, I read some posts.

Although is not that easy to migrate from 2 to 3, now the gears are spinning a bit (just to use a related term) and the ideas are becoming clear, but I still have some doubts.

My application requires some static files, which must be uploaded in a Kubernetes Persistent Volume Claim (PVC). So I created a new application via CLI util 'oc', using my code on a GitHub repo - but I tested also S2I with local folder - and created, mounted and associated a PVC to my application.

The created pod on container start, crashes ("crash loop backoff") since the files on the PVC are missing.

So, via the command oc rsync <local path> <pod>:<remote path> (Doc reference), I tried to push the files on the pod but since it crashes, I cannot access to the mounted PVC to push the needed files: both tar and rsync methods fail. (I suppose this is the reason)

So, what isn't clear to me is how can I push the files on the PVC without mounting it? Is there another way?

I was thinking that I could create first an empty application (via CLI oc new-app --allow-missing-images), create, mount and associate the PVC, start the pod, push the files and then create a new build from S2I and GitHub and then deploy. I'm not sure it would work because I think the pod may end itself too early without letting me to push the files. Could it work?

Thank you.

-- Alexander Cerutti
kubernetes-pvc
openshift

0 Answers