Created
March 18, 2021 01:12
-
-
Save mister2d/bf80f8c510f962a39a6d7050752adf52 to your computer and use it in GitHub Desktop.
Simple Nomad job to deploy a VM using the qemu driver.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "resinstack-small" { | |
datacenters = ["home"] | |
group "qcow2" { | |
constraint { | |
attribute = "${meta.node_type}" | |
value = "metal" | |
} | |
network { | |
port "ssh" {} | |
} | |
update { | |
max_parallel = 1 | |
health_check = "checks" | |
min_healthy_time = "0s" | |
healthy_deadline = "5m" | |
progress_deadline = "10m" | |
auto_revert = true | |
canary = 0 | |
stagger = "30s" | |
} | |
task "server" { | |
driver = "qemu" | |
resources { | |
memory = 4096 | |
cpu = 2048 | |
} | |
service { | |
name = "res01" | |
port = "ssh" | |
check { | |
name = "healthcheck" | |
type = "tcp" | |
port = "ssh" | |
interval = "10s" | |
timeout = "2s" | |
} | |
} | |
config { | |
image_path = "local/aio.qcow2" | |
accelerator = "kvm" | |
args = ["-device", "e1000,netdev=user.0", "-netdev", "user,id=user.0,hostfwd=tcp::${NOMAD_PORT_ssh}-:22"] | |
} | |
artifact { | |
source = "https://web.ingress.service.consul/images/aio.qcow2" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment