nomad

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

bastard-operator.nomad (1280B)


      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     task "nginx" {
     24       driver = "podman"
     25 
     26       config {
     27         image = "docker.io/library/nginx:stable-alpine"
     28         ports = ["https"]
     29         volumes = [
     30           # mount the templated config from the task directory to the container
     31           "local/bastard.conf:/etc/nginx/conf.d/bastard.conf",
     32         ]
     33       }
     34 
     35       volume_mount {
     36         volume = "tls"
     37         destination = "/etc/letsencrypt"
     38       }
     39 
     40       template {
     41         destination = "${NOMAD_TASK_DIR}/bastard.conf"
     42         data = file("./templates/nginx.conf.tmpl")
     43       }
     44 
     45       resources {
     46         memory = 50
     47         memory_max = 128
     48         cpu    = 200
     49       }
     50     }
     51 
     52     task "bastard" {
     53       driver = "podman"
     54 
     55       config {
     56         image = "127.0.0.1:5000/bastard-operator:latest"
     57         force_pull = true
     58         ports = ["http"]
     59       }
     60 
     61       resources {
     62         memory = 50
     63         memory_max = 128
     64         cpu    = 200
     65       }
     66     }
     67   }
     68 }