1 Reply Latest reply on Jan 23, 2017 3:48 PM by alininja

    BuildConfig with Persistent Volume Claim

    alininja

      Hi,

       

      I'm trying to having container A package the application and container B (like Nginx) serve the packaged application.

       

      I am on:

      oc v3.2.0.44

      kubernetes v1.2.0-36-g4a3f9c5

       

      So I cannot use init containers, like:

      docker - How to mimic '--volumes-from' in Kubernetes - Stack Overflow

       

      I've tried using a container in the deployment process to package the application onto a persistent volume claim.  The packaged application saves onto the persistent volume claim successfully, but the deployment/pod continuously restarts the container.  I tried using the pre hook to force a fail, but could not.

       

      So I'm trying to see if I can mount a persistent volume claim on to a build config.  So the build will save the packaged application on to the persistent volume claim.

       

      I have not been able to find an example of a buildconfig template that has an attached persistent volume.  Is this even possible?

       

      Thank you for any help you can provide.

       

      PS: Container A contains nodeJS with an Ember application.  I want to use it to build the static files for Nginx (container B) to serve.  So because container A isn't running a server, it always ends, but OpenShift thinks it is crashing.

        • 1. Re: BuildConfig with Persistent Volume Claim
          alininja

          In case it helps others, I ended up just deploying a pseudo init container by running my task and then starting a basic server that listens on a port that nobody uses.  The task saves the files to the persistent volume that is then used by another container.  The deployment succeeds because the fake server is running and not crashing and deployments have access to volume mounts, which builds don't.