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

Gluster Volume per Container or Shared Gluster Volume #14

Closed
Vad1mo opened this issue Dec 8, 2017 · 6 comments
Closed

Gluster Volume per Container or Shared Gluster Volume #14

Vad1mo opened this issue Dec 8, 2017 · 6 comments

Comments

@Vad1mo
Copy link

Vad1mo commented Dec 8, 2017

I manually created a gluster volume gv0. Now I had the expectation that when use the plugin, I can use this single gluster volume gv0 for multiple container.

I guess It is not intended to be used in this way, (or I can't find an alternative), because the data are stored in the root folder of the gluster volume gv0/. I was actually expecting them in gv0/portainer-data/...

So is it intended that each container should have its own gluster volume?

volumes:
  portainer-data:
    driver: glusterfs
    driver_opts:
      voluri: "localhost:gv0"
@sapk
Copy link
Owner

sapk commented Dec 8, 2017

That how docker-compose works. It define the name of volume by default by prepending with stack name. You can define a volume in docker and use docker-compose volume external : https://docs.docker.com/compose/compose-file/#external.
If you use plugin directly in host (not docker plugin) it has a option to mount gluster on gluster volume name so even if there is multiple docker volume only on is mount and shared by gluster.

MountUniqNameFlag = "mount-uniq"
It should be able to do the same with docker-plugin but need to be passed by env variable (not implemented)

@Vad1mo
Copy link
Author

Vad1mo commented Dec 8, 2017

the name of the volume glusterfs:latest portainer_portainer-data is fine for me. I was expecting that there is a way where its possible to use a gluster volume like gv0 for many different containers at the same time. eg. gv0/postgress-db-data and gv0/mysql-db-dta

But I guess the best option for that is to automatically create gluster volumes on demand.

@Vad1mo
Copy link
Author

Vad1mo commented Dec 8, 2017

btw. did you look at https://github.com/heketi/heketi, its basically a rest api for gluster, might be an option if you plan to add an option that can create volumes on demand

@sapk
Copy link
Owner

sapk commented Dec 8, 2017

If you use --mount-uniq it will mount base on volume name so only one mount on host.

@sapk
Copy link
Owner

sapk commented Dec 8, 2017

yes in the todo list #5 and add env #15 for docker-plugin just rigth now ^^

@sapk
Copy link
Owner

sapk commented Dec 10, 2017

fix by #16

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

No branches or pull requests

2 participants