diff --git a/client/driver/rkt.go b/client/driver/rkt.go index 1005428783e..7ad4ad4d073 100644 --- a/client/driver/rkt.go +++ b/client/driver/rkt.go @@ -83,7 +83,8 @@ type RktDriverConfig struct { Volumes []string `mapstructure:"volumes"` // Host-Volumes to mount in, syntax: /path/to/host/directory:/destination/path/in/container InsecureOptions []string `mapstructure:"insecure_options"` // list of args for --insecure-options - Debug bool `mapstructure:"debug"` // Enable debug option for rkt command + NoOverlay bool `mapstructure:"no_overlay"` // disable overlayfs for rkt run + Debug bool `mapstructure:"debug"` // Enable debug option for rkt command } // rktHandle is returned from Start/Open as a handle to the PID @@ -156,6 +157,9 @@ func (d *RktDriver) Validate(config map[string]interface{}) error { "volumes": &fields.FieldSchema{ Type: fields.TypeArray, }, + "no_overlay": &fields.FieldSchema{ + Type: fields.TypeBool, + }, "insecure_options": &fields.FieldSchema{ Type: fields.TypeArray, }, @@ -280,6 +284,11 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e cmdArgs = append(cmdArgs, "run") + // disable overlayfs + if driverConfig.NoOverlay { + cmdArgs = append(cmdArgs, "--no-overlay=true") + } + // Write the UUID out to a file in the state dir so we can read it back // in and access the pod by UUID from other commands uuidPath := filepath.Join(ctx.TaskDir.Dir, "rkt.uuid") diff --git a/website/source/docs/drivers/rkt.html.md b/website/source/docs/drivers/rkt.html.md index 3affd0345a5..6b7de6ee0ce 100644 --- a/website/source/docs/drivers/rkt.html.md +++ b/website/source/docs/drivers/rkt.html.md @@ -100,6 +100,9 @@ The `rkt` driver supports the following configuration in the job spec: * `debug` - (Optional) Enable rkt command debug option. +* `no_overlay` - (Optional) When enabled, will use `--no-overlay=true` flag for 'rkt run'. + Useful when running jobs on older systems affected by https://github.com/rkt/rkt/issues/1922 + * `volumes` - (Optional) A list of `host_path:container_path` strings to bind host paths to container paths.