nomad

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

waldhart.nomad (1417B)


      1 job "waldhart" {
      2   datacenters = ["dc1"]
      3   type = "batch"
      4 
      5   vault {}
      6 
      7   periodic {
      8     crons = [
      9       "@daily"
     10     ]
     11   }
     12 
     13   group "waldhart" {
     14     count = 1
     15 
     16     task "update-availability" {
     17       driver = "podman"
     18 
     19       template {
     20         env = true
     21         destination = "${NOMAD_SECRETS_DIR}/env"
     22         data = <<EOT
     23 WALDHART_URL={{with secret "kv/waldhart"}}{{index .Data.data.waldhart_url}}{{end}}
     24 WALDHART_USERNAME={{with secret "kv/waldhart"}}{{index .Data.data.waldhart_username}}{{end}}
     25 WALDHART_PASSWORD={{with secret "kv/waldhart"}}{{index .Data.data.waldhart_password}}{{end}}
     26 CALDAV_URL={{with secret "kv/waldhart"}}{{index .Data.data.caldav_url}}{{end}}
     27 CALDAV_CALENDAR_NAME=Skischule
     28 CALDAV_USERNAME={{with secret "kv/waldhart"}}{{index .Data.data.caldav_username}}{{end}}
     29 CALDAV_PASSWORD="{{with secret "kv/waldhart"}}{{index .Data.data.caldav_password}}{{end}}"
     30 SEASON=2025 # December - March next year
     31 #PYTHON_CALDAV_DEBUGMODE=DEBUG
     32 #LOGLEVEL=DEBUG
     33 EOT
     34       }
     35 
     36       config {
     37         image = "127.0.0.1:5000/waldhart:38d521ad0d6249427b3f02d9f062228bdd4edfd5"
     38         #command = "/bin/sh"
     39         #args = ["-c", "sleep 3600"]
     40         force_pull = true
     41       }
     42 
     43       constraint {
     44         # image only built for arm
     45         attribute = "${attr.cpu.arch}"
     46         value     = "arm64"
     47       }
     48 
     49       resources {
     50         memory = 50
     51         memory_max = 128
     52         cpu    = 200
     53       }
     54     }
     55   }
     56 }