nomad

HCL and Docker files for Nomad deployments
git clone https://git.in0rdr.ch/nomad.git
Log | Files | Refs | Pull requests |Archive | README

bastard-operator.nomad (1400B)


      1 job "bastard" {
      2   datacenters = ["dc1"]
      3 
      4   group "operator" {
      5     count = 1
      6 
      7     volume "tls" {
      8       type = "csi"
      9       source = "certbot"
     10       access_mode = "multi-node-multi-writer"
     11       attachment_mode = "file-system"
     12     }
     13 
     14     network {
     15       port "http" {
     16         to = 8080
     17       }
     18       port "https" {
     19         static = 44404
     20       }
     21     }
     22 
     23     constraint {
     24       # image only built for arm
     25       attribute = "${attr.cpu.arch}"
     26       value     = "arm64"
     27     }
     28 
     29     task "nginx" {
     30       driver = "podman"
     31 
     32       config {
     33         image = "docker.io/library/nginx:stable-alpine"
     34         ports = ["https"]
     35         volumes = [
     36           # mount the templated config from the task directory to the container
     37           "local/bastard.conf:/etc/nginx/conf.d/bastard.conf",
     38         ]
     39       }
     40 
     41       volume_mount {
     42         volume = "tls"
     43         destination = "/etc/letsencrypt"
     44       }
     45 
     46       template {
     47         destination = "${NOMAD_TASK_DIR}/bastard.conf"
     48         data = file("./templates/nginx.conf.tmpl")
     49       }
     50 
     51       resources {
     52         memory = 50
     53         memory_max = 128
     54         cpu    = 200
     55       }
     56     }
     57 
     58     task "bastard" {
     59       driver = "podman"
     60 
     61       config {
     62         image = "127.0.0.1:5000/bastard-operator:latest"
     63         force_pull = true
     64         ports = ["http"]
     65       }
     66 
     67       resources {
     68         memory = 50
     69         memory_max = 128
     70         cpu    = 200
     71       }
     72     }
     73   }
     74 }