-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add Support for Volumes (docker-compose.uffizzi.yml) #126
Comments
Now I think we want "generic ephemeral inline volumes". They're new, in beta in k8s 1.21 and will be "stable" in 1.23. |
We want to support this use case: https://github.com/BretFisher/allhands22/blob/e96efb349c85e27ccc778b629f32a4f5060eb71c/docker-compose.test.yml#L10-L11 |
@zipofar Please see this example for generic ephemeral volumes. https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/#generic-ephemeral-volumes To support the
|
@gadkins What do you think about this method of determining volumes: For example user have compose file like this:
Our idea is that the user add rules like this:
|
Why we should use some additional things for volumes.
For Let's consider a scenario when we upload some files from a host to the our uffizzi database. Next we send these files to the uffizzi controller(it's in k8s). In this case there is no way to load these files into container, that locate in a different pod. That's why we offer the solution above with additional tag |
Waiting for controller update |
By now we updated design of
Example compose file:
|
@jpthurman @axisofentropy @gadkins After long discussion was find 2 variants how we can implement this: 1. With addition extra config item
For example use this docker-compose
Advantages:
Disadvantages:
2. With addition self hosted cloud storage** (https://min.io/product/kubernetes) to kubernetes cluster.In this case we can upload files for volumes from Advantages:
Disadvantages:
|
Thank you for composing this. I don't think option 1 is what we're looking for. Option 2 is good, but what's special about MinIO or other object storage? Couldn't the init container fetch the files from |
I see that the |
We discussed this today and I think we're going to shrink the scope of this ticket to support only "empty" volumes. A use case for one of our customers: mounting an empty volume to I know we say it a lot, but we want this to behave much like Probably more specifications and protoyping coming soon, but let me know what you think! (We will specify a new ticket soon for the other big use case of volumes that should have some files in them before preview containers start. I think Kubernetes' new "Init Containers" are the best way to implement this. Maybe they can even pull files directly from GitHub so we don't have to store them?) |
But for opensource version we do not use github |
The lifetime of the volume should be limited by the lifecycle of a namespace. If a pull request is closed - the volume is removed. If a commit is added to the branch - it should persist. |
When a namespace is deleted - the PVC and PV gets deleted too As users can have their own storage classes, the storage class should be provided in an ENV variable, |
Next points to research:
A GKE persistent disk can be attached only to one node. Possible solutions are either using a CloudFilestore or setting up our own NFS server as described here
|
If more than one container in the compose mounts the same volume, then only one container should have Read + Write permissions. All others should be Read-only. In this case, the you should be required to add the |
Please note that volumes should be supported in both open-source and closed source Uffizzi. This is different that was discussed here in Slack. |
There is one more question about anonymous volume like:
Should we implement this type volumes in this issue? |
Use case example: when a customer makes a deployment with postgres and seeds database. If they say |
@zipofar Yes, that is the way we want people to define anonymous volumes and use them to persist state after updates to the preview deployment. |
Add new
|
HOW TO TEST:
We can use this compose file for check anonymous volumes:
We can use this compose file for check named volumes:
|
TEST REMOVE UNUSED VOLUMES:
Expected result: db should have init (empty) state |
Long syntax for named volume:
|
Read only for short syntax:
|
The test app repository: https://github.com/zipofar/test_rails |
TESTED - OK ❗ |
TESTED with GitHub controller - OK |
Add Uffizzi Compose support for volumes (short and long syntax) as define by Docker Compose here:
https://docs.docker.com/compose/compose-file/compose-file-v3/#volumes
The text was updated successfully, but these errors were encountered: