Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web/nginx: shared volume (pvc - persistent volume claim) #8

Merged
merged 2 commits into from
Mar 23, 2020

Conversation

ppanero
Copy link
Member

@ppanero ppanero commented Mar 20, 2020

Now Nginx and Web nodes share a volume (Persistent) for statics. However, it needs the image to have the statics (Addresse here inveniosoftware/cookiecutter-invenio-rdm#56).

Since volumes override the folder where they are being mounted (empty them). The web pod folder is "wiped out" of statics. To solve the issue an initContainer is launched, this will mount the volume in a temporary location and copy the statics to it. Therefore, it will be initialized with the correct statics. The copy of those is made to overwrite old ones, so there is no problem with future deployments.

The serving of statics has been off-loaded to nginx. Deeper consolidations are out of the scope of this PR, but will be addressed as part of #7 and #6.

In addition, at the moment the initContainer is launched once per pod. Which means that if there are 6 web pods the assets will be copied 6 times. This is not an issue since OpenShift provides a distributed locking system and all pod's assets are the same. This will be improved by adding nginx as a sidecar container and using an emptyDir instead of a volume. Will be treated in #9

Requires: inveniosoftware/cookiecutter-invenio-rdm#56

@ppanero ppanero changed the title web/nginx: shared volume (pvc - persistent volume claim) WIP: web/nginx: shared volume (pvc - persistent volume claim) Mar 20, 2020
@ppanero ppanero force-pushed the volume branch 2 times, most recently from 6c60255 to e4fcd59 Compare March 20, 2020 15:08
@ppanero ppanero changed the title WIP: web/nginx: shared volume (pvc - persistent volume claim) web/nginx: shared volume (pvc - persistent volume claim) Mar 20, 2020
invenio/templates/application.yaml Outdated Show resolved Hide resolved
invenio/templates/application.yaml Show resolved Hide resolved
invenio/templates/volumes.yaml Outdated Show resolved Hide resolved
Co-authored-by: Georgios Lignos <glignos93@gmail.com>
@ppanero ppanero merged commit 6b2d57e into inveniosoftware:master Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants