open-nomad/drivers/shared/executor
Danielle Lancashire 4fbcc668d0
volumes: Add support for mount propagation
This commit introduces support for configuring mount propagation when
mounting volumes with the `volume_mount` stanza on Linux targets.

Similar to Kubernetes, we expose 3 options for configuring mount
propagation:

- private, which is equivalent to `rprivate` on Linux, which does not allow the
           container to see any new nested mounts after the chroot was created.

- host-to-task, which is equivalent to `rslave` on Linux, which allows new mounts
                that have been created _outside of the container_ to be visible
                inside the container after the chroot is created.

- bidirectional, which is equivalent to `rshared` on Linux, which allows both
                 the container to see new mounts created on the host, but
                 importantly _allows the container to create mounts that are
                 visible in other containers an don the host_

private and host-to-task are safe, but bidirectional mounts can be
dangerous, as if the code inside a container creates a mount, and does
not clean it up before tearing down the container, it can cause bad
things to happen inside the kernel.

To add a layer of safety here, we require that the user has ReadWrite
permissions on the volume before allowing bidirectional mounts, as a
defense in depth / validation case, although creating mounts should also require
a priviliged execution environment inside the container.
2019-10-14 14:09:58 +02:00
..
proto Driver networking support 2019-07-31 01:03:20 -04:00
test-resources/busybox tests: busybox only depends on arch 2019-01-07 08:36:32 -05:00
client.go Driver networking support 2019-07-31 01:03:20 -04:00
exec_utils.go executor: removed unused field from exec_utils.go 2019-09-30 11:57:34 -04:00
executor.go executor: rename wrapNetns to withNetworkIsolation 2019-09-30 21:38:31 -04:00
executor_basic.go executor: rename wrapNetns to withNetworkIsolation 2019-09-30 21:38:31 -04:00
executor_linux.go volumes: Add support for mount propagation 2019-10-14 14:09:58 +02:00
executor_linux_test.go volumes: Add support for mount propagation 2019-10-14 14:09:58 +02:00
executor_plugin.go goimports 2019-01-22 15:44:31 -08:00
executor_test.go tests: Fix binary dir permissions 2019-05-24 11:31:12 -04:00
executor_universal_linux.go executor: rename wrapNetns to withNetworkIsolation 2019-09-30 21:38:31 -04:00
executor_unix.go default e.getAllPids in executor_basic 2019-07-18 10:57:27 -04:00
executor_windows.go default e.getAllPids in executor_basic 2019-07-18 10:57:27 -04:00
legacy_executor_wrapper.go drivers/docker: handle shutdown of upgraded tasks correctly 2019-01-24 14:21:59 -05:00
libcontainer_nsenter_linux.go comment on using init() for libcontainer handling 2019-04-19 09:49:04 -04:00
pid_collector.go pid_collector getAllPids -> getAllPidsByScanning 2019-07-17 17:31:20 -04:00
pid_collector_test.go drivers: Move client/drivers/executor to drivers/shared/executor 2018-11-30 10:46:13 +01:00
plugins.go driver: add pre09 migration logic 2019-01-18 18:31:01 -05:00
pty_unix.go executors: implement streaming exec 2019-05-10 19:17:14 -04:00
pty_windows.go executors: implement streaming exec 2019-05-10 19:17:14 -04:00
resource_container_default.go drivers: Move client/drivers/executor to drivers/shared/executor 2018-11-30 10:46:13 +01:00
resource_container_linux.go resource_container_linux new getAllPidsByCgroup 2019-07-17 17:31:36 -04:00
server.go Driver networking support 2019-07-31 01:03:20 -04:00
utils.go Use init to handle plugin invocation 2019-06-13 16:48:01 -04:00
utils_unix.go executor: merge plugin shim with executor package 2018-12-06 21:13:45 -05:00
utils_windows.go executor: merge plugin shim with executor package 2018-12-06 21:13:45 -05:00
z_executor_cmd.go comment on use of init() for plugin handlers 2019-06-18 20:54:55 -04:00