Add hcl extention for nomad files
to get syntax highlighting be default.
This commit is contained in:
60
2-nomad-config/hello-world.nomad.hcl
Normal file
60
2-nomad-config/hello-world.nomad.hcl
Normal file
@@ -0,0 +1,60 @@
|
||||
job "hello-world" {
|
||||
group "servers" {
|
||||
network {
|
||||
port "www" {
|
||||
to = -1
|
||||
}
|
||||
}
|
||||
|
||||
service {
|
||||
name = "hello-world"
|
||||
port = "www"
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
]
|
||||
|
||||
check {
|
||||
name = "alive"
|
||||
type = "tcp"
|
||||
port = "www"
|
||||
interval = "10s"
|
||||
timeout = "2s"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Tasks are individual units of work that are run by Nomad.
|
||||
task "web" {
|
||||
# This particular task starts a simple web server within a Docker container
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "busybox:1"
|
||||
command = "httpd"
|
||||
args = ["-v", "-f", "-p", "${NOMAD_PORT_www}", "-h", "/local"]
|
||||
ports = ["www"]
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<-EOF
|
||||
<h1>Hello, Nomad!</h1>
|
||||
<ul>
|
||||
<li>Task: {{env "NOMAD_TASK_NAME"}}</li>
|
||||
<li>Group: {{env "NOMAD_GROUP_NAME"}}</li>
|
||||
<li>Job: {{env "NOMAD_JOB_NAME"}}</li>
|
||||
<li>Metadata value for foo: {{env "NOMAD_META_foo"}}</li>
|
||||
<li>Currently running on port: {{env "NOMAD_PORT_www"}}</li>
|
||||
</ul>
|
||||
EOF
|
||||
destination = "local/index.html"
|
||||
}
|
||||
|
||||
# Specify the maximum resources required to run the task
|
||||
resources {
|
||||
cpu = 50
|
||||
memory = 64
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user