open-nomad/e2e/isolation/input/exec_host.nomad
Seth Hoenig 8ee9835923 drivers/exec+java: Add task configuration to restore previous PID/IPC isolation behavior
This PR adds pid_mode and ipc_mode options to the exec and java task
driver config options. By default these will defer to the default_pid_mode
and default_ipc_mode agent plugin options created in #9969. Setting
these values to "host" mode disables isolation for the task. Doing so
is not recommended, but may be necessary to support legacy job configurations.

Closes #9970
2021-02-08 14:26:35 -06:00

41 lines
630 B
HCL

job "exec" {
datacenters = ["dc1"]
type = "batch"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "exec" {
task "exec" {
driver = "exec"
config {
command = "bash"
args = [
"-c", "local/pid.sh"
]
pid_mode = "host"
ipc_mode = "host"
}
template {
data = <<EOF
#!/usr/bin/env bash
echo my pid is $BASHPID
EOF
destination = "local/pid.sh"
perms = "777"
change_mode = "noop"
}
resources {
cpu = 100
memory = 64
}
}
}
}