The nomad team has been working very hard on making templated deploys easy for this they have released the tech preview of nomad-pack. This talk discusses some of my observations while migrating nomad job files over to nomad-pack
1. 10 things i learned building
Nomad packs
Bram Vogelaar
@attachmentgenie
2. • Used to be a Molecular Biologist
• Then became a Dev, now an Ops
• Currently Cloud Engineer @ The Factory
• Amsterdam HUG organizer
• Almost author => Workload Orchestration Made Easy With Nomad
$ whoami
3. l Open-source tool for dynamic workload scheduling
l Batch, containerized, and non-containerized applications.
l Has native Consul and Vault integrations.
l Has token based access setup.
l Jobs written in (H)ashiCorp (C)onfiguration (L)anguage
https://www.nomadproject.io/
Nomad
4. Nomad Job Structure
job "lorem-ipsum" {
group ”frontend" {
network {
port "http" { to = ”3000” }
}
service {
name = ”lorem"
port. = ”http"
}
task "server" {
driver = "docker"
config {
image = ”cicero/lorem-ipsum:v1.0.0"
ports = ["http"]
}
}
}
5. Surprisingly Dynamic
job "lorem-ipsum" {
group ”frontend" {
network {
port "http" { to = ”3000” }
}
service {
name = ”lorem"
port. = ”http"
}
task "server" {
driver = "docker"
config {
image = ”cicero/lorem-ipsum:v1.0.0"
ports = ["http"]
}
}
}
6. Job configuration includes options for but is not limited to:
• Datacenters
• Region
• Namespace
• Constraints
• Count
• Restart Configuration
• Network
• Volumes
• Service Checks
• Consul Connect
• Resource Limits
• Artifacts
• Templates
• Autoscaler Configuration
Incredibly Dynamic
8. • Levant
• Templating and packaging tool
• Easily deploy popular applications to Nomad
• Re-use common patterns across internal applications
• Find and share job definitions with the Nomad community
• Jobs written in (H)ashiCorp (C)onfiguration (L)anguage
• Templates are written using Go Template Syntax.
• Nightlies only right now!
Nomad Pack
https://github.com/hashicorp/nomad-pack
9. $ nomad-pack registry list
$ nomad-pack registry add o11y https://github.com/attachmentgenie/nomad-pack-o11y-registry $
$ nomad-pack run grafana --var job_name=dashboard --registry=o11y
$ nomad-pack run packs/grafana -f vars/grafana.hcl –f vars/lab.hcl
Pack Registries
https://github.com/hashicorp/nomad-pack-o11y-registry
12. app {
url = "https://grafana.com/"
author = "Grafana Labs"
}
pack {
name = "grafana"
description = "Grafana is a multi-platform open source analytics and interactive visualization tool."
url = "https://github.com/attachmentgenie/nomad-pack-o11y-registry/grafana"
version = "0.1.0"
}
metadata.hcl
13. variable "datacenters" {
description = "A list of datacenters in the region which are eligible for task placement"
type = list(string)
default = [“dc1”]
}
Variable “resources” {
description = “The resource to assign to the Grafana service task”
type = object({
cpu = number
memory = number
})
default = {
cpu = 200,
memory = 256
}
}
variables.hcl