mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
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.
63 lines
1007 B
HCL
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
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
}
|