mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
Cannot set a user for raw_exec tasks, because doing so does not work with the 0700 root owned client data directory that we setup in the e2e cluster in accordance with the Nomad hardening guide.
45 lines
727 B
HCL
45 lines
727 B
HCL
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
# This "sleep" job simply invokes 'sleep infinity' using raw_exec. It is great
|
|
# for demonstrating features of the Nomad e2e suite with a trivial job spec.
|
|
|
|
job "sleep" {
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
|
|
group "group" {
|
|
|
|
update {
|
|
min_healthy_time = "2s"
|
|
}
|
|
|
|
reschedule {
|
|
attempts = 0
|
|
unlimited = false
|
|
}
|
|
|
|
restart {
|
|
attempts = 0
|
|
mode = "fail"
|
|
}
|
|
|
|
task "task" {
|
|
driver = "raw_exec"
|
|
|
|
config {
|
|
command = "sleep"
|
|
args = ["infinity"]
|
|
}
|
|
|
|
resources {
|
|
cpu = 10
|
|
memory = 10
|
|
}
|
|
}
|
|
}
|
|
}
|