gluster / gluster-containers

Dockerfiles (CentOS, Fedora, Red Hat) for GlusterFS
https://github.com/gluster/gluster-containers/pkgs/container/gluster-containers
223 stars 135 forks source link

Execute LVM commands on the host instead of in the container #156

Closed nixpanic closed 5 years ago

nixpanic commented 5 years ago

When Gluster runs in a container, it is recommended to run the LVM commands on the host, and not inside the container. With the new 'exec-on-host' shell script, the commands are executed through 'nsenter' which expects the /-filesystem of the host to be bind-mounted (as a volume) on /rootfs. It is also required that the container runs in the PID-namespace of the host, so that PID 1 refers to the init process on the host.

If the /-filesystem is not available under /rootfs in the container, or running 'true' through the 'exec-on-host' script fails, a fallback is done to execute the command inside the container anyway.

See-also: https://github.com/heketi/heketi/pull/1650

nixpanic commented 5 years ago

Working on resolving unrelated CI/build issues in #158

nixpanic commented 5 years ago

This is now rebased on top of #158, please merge that one before this change.

158 has been merged.

phlogistonjohn commented 5 years ago

Still looks good to me and feel free to merge, but I don't have rights in this repo to do it myself. :-)