open-nomad/plugins/drivers
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: don't recreate existing network namespaces 2019-09-25 14:58:17 -04:00
testutils driver/networking: don't recreate existing network namespaces 2019-09-25 14:58:17 -04:00
utils Remove some dead code 2019-01-08 09:11:48 -05:00
client.go driver/networking: don't recreate existing network namespaces 2019-09-25 14:58:17 -04:00
cstructs.go drivers: re-export ResourceUsage structs 2019-01-08 09:11:47 -05:00
driver.go volumes: Add support for mount propagation 2019-10-14 14:09:58 +02:00
errors.go Standardize driver health description messages for all drivers 2019-01-06 22:06:38 -06:00
execstreaming.go implemment streaming exec handling in driver grpc handlers 2019-05-09 16:49:08 -04:00
plugin.go drivers: pass logger through driver plugin client 2019-01-25 09:38:41 -05:00
server.go driver/networking: don't recreate existing network namespaces 2019-09-25 14:58:17 -04:00
task_handle.go executor: add pre 0.9 client and wrapper 2019-01-18 18:30:58 -05:00
utils.go Add NetworkIsolation in TaskConfig (#6135) 2019-08-15 13:05:55 -04:00
utils_test.go Simplify proto conversion and handle swap 2019-03-30 15:18:28 -04:00
versions.go Add plugin API versioning to plugin loader and plugins 2018-12-18 16:48:00 -08:00