Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a no_overlay option for the rkt task config. #2694

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion client/driver/rkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ type RktDriverConfig struct {
PortMap map[string]string `mapstructure:"-"` // A map of host port and the port name defined in the image manifest file
Volumes []string `mapstructure:"volumes"` // Host-Volumes to mount in, syntax: /path/to/host/directory:/destination/path/in/container

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
Expand Down Expand Up @@ -155,6 +156,9 @@ func (d *RktDriver) Validate(config map[string]interface{}) error {
"volumes": &fields.FieldSchema{
Type: fields.TypeArray,
},
"no_overlay": &fields.FieldSchema{
Type: fields.TypeBool,
},
},
}

Expand Down Expand Up @@ -264,6 +268,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")
Expand Down
3 changes: 3 additions & 0 deletions website/source/docs/drivers/rkt.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,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'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backticks around the command line flag:

... use `--no-overlay=true` flag for ...

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.

Expand Down