Files
nomad/e2e/dynamic_host_volumes/input/sticky.nomad.hcl
Tim Gross 3f2d4000a6 E2E: dynamic host volume tests for sticky volumes (#24869)
Add tests for dynamic host volumes where the claiming jobs have `volume.sticky =
true`. Includes a test for forced rescheduling and a test for node drain.

This changeset includes a new `e2e/v3`-style package for creating dynamic host
volumes, so we can reuse that across other tests.
2025-02-07 15:50:54 -05:00

63 lines
1007 B
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
job "example" {
# this job will get deployed and recheduled a lot in this test, so make sure
# it happens as quickly as possible
update {
min_healthy_time = "1s"
}
reschedule {
delay = "5s"
delay_function = "constant"
unlimited = true
}
group "web" {
network {
mode = "bridge"
port "www" {
to = 8001
}
}
restart {
attempts = 0
mode = "fail"
}
volume "data" {
type = "host"
source = "sticky-volume"
sticky = true
}
task "http" {
driver = "docker"
config {
image = "busybox:1"
command = "httpd"
args = ["-v", "-f", "-p", "8001", "-h", "/var/www"]
ports = ["www"]
}
volume_mount {
volume = "data"
destination = "/var/www"
}
resources {
cpu = 128
memory = 128
}
}
}
}