-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: add support for additional volumes #339
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just pushing initial look through - there's a lot here, I'm not sure I've grokked all of it just yet.
6924a92
to
859194e
Compare
1af0325
to
59f10d5
Compare
bcb4b20
to
1a03365
Compare
I just realised, that all PVCs created will be flagged with having backups enabled on them. There may be use cases where the volume does not need to be backed up. Ie, a volume that is used as a temporary holding ground for work files that probably don't need to be backed up. For example, temporary backups etc, a sort of playground type directory that is persistent but not data that needs to be backed up. I think it might be worth having a way to have the volume ignored from backups, like
Setting that to Edit: now possible to disable backups on a volume |
08b58b7
to
308d9ed
Compare
35d83ad
to
f8a52fc
Compare
f8a52fc
to
8be0bc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this - our examples using it work well, and sensible limits/guardrails in place.
This adds support for multiple volumes, currently all volumes provisioned in this manner will default to the Lagoon
bulk
storage class which will almost always be aReadWriteMany
volume (depends on installation).The default request size will be
5Gi
. For some storage provisioners, this value could be ignored. For example, AWS EFS backed storage doesn't restrict data on these volumes to the size in the claim.Usage
Volume definitions
In a
docker-compose.yml
file,volumes
will need to be defined with a labellagoon.type: persistent
.Service linking
Once a volume has been defined with the label, a service needs to be informed that it can use this volume.
The label used is structured as
lagoon.volumes.${volume_name}.path
, and the value of the label must be the path to mount the volume.Conditions
There are some conditions to additional volumes that users need to be aware of.
Default persistent volumes
nginx-php-persistent
,basic-persistent
,node-persistent
,python-persistent
), it will be created and named as the name of the service (unless thelagoon.persistent.name
label is assigned).volumes
block is also named the same as a default volume would be, it will be ignored and only the default volume will be created.lagoon.volumes.${volume_name}.path
is also defined on a service that has a default volume (or a volume linked to it using thelagoon.persistent.name
label, it will also be ignored and the value of thelagoon.persistent
path will be used.Ignored volume
volumes
block has a labellagoon.type: none
it will not be created.volumes
block has a labellagoon.type
of a type (currently onlypersistent
), but it is not consumed by any service using alagoon.volumes.${volume_name}.path
, then the volume will not be created.Maximum number of volumes
Supported service types
Currently, the only service types that support additional volumes are the following
basic
/basic-persistent
worker
/worker-persistent
node
/node-persistent
python
/python-persistent
nginx
/nginx-php
/nginx-php-persistent
cli
/cli-persistent
Adding a volume to any other type will result in an error during a build.
Is it possible to extend a non
-persistent
service with additional volumes?The implementation of additional volumes makes the
-persistent
type almost irrelevant.It makes changing a lagoon type from a
basic
tobasic-persistent
(or other similar type changes) mostly not required. Thedocker-compose.yml
can be extended instead to include the additional volumes as required, including a replacement for what would be a default volume.This would also make it possible to remove the volumes in the future if they are no longer required without having to recreate the service, as changing a
lagoon.type
is not a very smooth process.See the example below that describes how this configuration looks for a
basic
service type.Example
basic-persistent
with additional volumesAn example is as below for a basic deployment that requests 3 volumes and shows how they could be mounted to a basic service. It also includes some examples of some of the conditions.
Example
basic
service type extended with volumesAn example is as below for a basic deployment that uses a service type that doesn't provide a default persistent volume (being a
basic
type), and shows how they can be mounted.