nomad

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

plugin-rocketduck-controller.nomad (1182B)


      1 # https://gitlab.com/rocketduck/csi-plugin-nfs/-/blob/main/nomad/controller.nomad
      2 
      3 variable "affinity_node" {
      4   type        = string
      5   default     = "na"
      6   description = "Prefer to schedule controller on this node. If no nodes match, placement is still successful."
      7 }
      8 
      9 job "plugin-rocketduck-controller" {
     10   datacenters = ["dc1"]
     11 
     12   affinity {
     13     attribute = "${node.unique.name}"
     14     value     = var.affinity_node
     15   }
     16 
     17   priority = 100
     18 
     19   group "controller" {
     20     task "plugin" {
     21       driver = "podman"
     22 
     23       config {
     24         image = "registry.gitlab.com/rocketduck/csi-plugin-nfs:1.1.0"
     25         force_pull = true
     26 
     27         args = [
     28           "--type=controller",
     29           "--node-id=${attr.unique.hostname}",
     30           "--nfs-server=turris.lan:/",
     31           "--mount-options=nolock,nfsvers=4,defaults",
     32         ]
     33 
     34         # required so the mount works even after stopping the container
     35         network_mode = "host"
     36         privileged = true
     37       }
     38 
     39       csi_plugin {
     40         id        = "rocketduck"
     41         type      = "controller"
     42         mount_dir = "/csi"
     43       }
     44 
     45       resources {
     46         memory = 256
     47         memory_max = 512
     48         cpu    = 500
     49       }
     50     }
     51   }
     52 }