Skip to content

Commit d43de0e

Browse files
committed
Add a no_overlay option for the rkt task config.
1 parent 67cd515 commit d43de0e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

client/driver/rkt.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ type RktDriverConfig struct {
8282
PortMap map[string]string `mapstructure:"-"` // A map of host port and the port name defined in the image manifest file
8383
Volumes []string `mapstructure:"volumes"` // Host-Volumes to mount in, syntax: /path/to/host/directory:/destination/path/in/container
8484

85-
Debug bool `mapstructure:"debug"` // Enable debug option for rkt command
85+
NoOverlay bool `mapstructure:"no_overlay"` // disable overlayfs for rkt run
86+
Debug bool `mapstructure:"debug"` // Enable debug option for rkt command
8687
}
8788

8889
// rktHandle is returned from Start/Open as a handle to the PID
@@ -155,6 +156,9 @@ func (d *RktDriver) Validate(config map[string]interface{}) error {
155156
"volumes": &fields.FieldSchema{
156157
Type: fields.TypeArray,
157158
},
159+
"no_overlay": &fields.FieldSchema{
160+
Type: fields.TypeBool,
161+
},
158162
},
159163
}
160164

@@ -264,6 +268,11 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e
264268
}
265269
cmdArgs = append(cmdArgs, "run")
266270

271+
// disable overlayfs
272+
if driverConfig.NoOverlay {
273+
cmdArgs = append(cmdArgs, "--no-overlay=true")
274+
}
275+
267276
// Write the UUID out to a file in the state dir so we can read it back
268277
// in and access the pod by UUID from other commands
269278
uuidPath := filepath.Join(ctx.TaskDir.Dir, "rkt.uuid")

website/source/docs/drivers/rkt.html.md

+3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ The `rkt` driver supports the following configuration in the job spec:
8888

8989
* `debug` - (Optional) Enable rkt command debug option.
9090

91+
* `no_overlay` - (Optional) When enabled, will use --no-overlay=true flag for 'rkt run'.
92+
Useful when running jobs on older systems affected by https://github.com/rkt/rkt/issues/1922
93+
9194
* `volumes` - (Optional) A list of `host_path:container_path` strings to bind
9295
host paths to container paths.
9396

0 commit comments

Comments
 (0)