github.com/adityamillind98/nomad@v0.11.8/jobspec/test-fixtures/basic.hcl (about)

     1  job "binstore-storagelocker" {
     2    region       = "fooregion"
     3    namespace    = "foonamespace"
     4    type         = "batch"
     5    priority     = 52
     6    all_at_once  = true
     7    datacenters  = ["us2", "eu1"]
     8    consul_token = "abc"
     9    vault_token  = "foo"
    10  
    11    meta {
    12      foo = "bar"
    13    }
    14  
    15    constraint {
    16      attribute = "kernel.os"
    17      value     = "windows"
    18    }
    19  
    20    constraint {
    21      attribute = "${attr.vault.version}"
    22      value     = ">= 0.6.1"
    23      operator  = "semver"
    24    }
    25  
    26    affinity {
    27      attribute = "${meta.team}"
    28      value     = "mobile"
    29      operator  = "="
    30      weight    = 50
    31    }
    32  
    33    spread {
    34      attribute = "${meta.rack}"
    35      weight    = 100
    36  
    37      target "r1" {
    38        percent = 40
    39      }
    40  
    41      target "r2" {
    42        percent = 60
    43      }
    44    }
    45  
    46    update {
    47      stagger           = "60s"
    48      max_parallel      = 2
    49      health_check      = "manual"
    50      min_healthy_time  = "10s"
    51      healthy_deadline  = "10m"
    52      progress_deadline = "10m"
    53      auto_revert       = true
    54      auto_promote      = true
    55      canary            = 1
    56    }
    57  
    58    task "outside" {
    59      driver = "java"
    60  
    61      config {
    62        jar_path = "s3://my-cool-store/foo.jar"
    63      }
    64  
    65      meta {
    66        my-cool-key = "foobar"
    67      }
    68    }
    69  
    70    group "binsl" {
    71      count = 5
    72  
    73      volume "foo" {
    74        type   = "host"
    75        source = "/path"
    76      }
    77  
    78      volume "bar" {
    79        type   = "csi"
    80        source = "bar-vol"
    81  
    82        mount_options {
    83          fs_type = "ext4"
    84        }
    85      }
    86  
    87      volume "baz" {
    88        type   = "csi"
    89        source = "bar-vol"
    90  
    91        mount_options {
    92          mount_flags = ["ro"]
    93        }
    94      }
    95  
    96      restart {
    97        attempts = 5
    98        interval = "10m"
    99        delay    = "15s"
   100        mode     = "delay"
   101      }
   102  
   103      reschedule {
   104        attempts = 5
   105        interval = "12h"
   106      }
   107  
   108      ephemeral_disk {
   109        sticky = true
   110        size   = 150
   111      }
   112  
   113      update {
   114        max_parallel      = 3
   115        health_check      = "checks"
   116        min_healthy_time  = "1s"
   117        healthy_deadline  = "1m"
   118        progress_deadline = "1m"
   119        auto_revert       = false
   120        auto_promote      = false
   121        canary            = 2
   122      }
   123  
   124      migrate {
   125        max_parallel     = 2
   126        health_check     = "task_states"
   127        min_healthy_time = "11s"
   128        healthy_deadline = "11m"
   129      }
   130  
   131      affinity {
   132        attribute = "${node.datacenter}"
   133        value     = "dc2"
   134        operator  = "="
   135        weight    = 100
   136      }
   137  
   138      spread {
   139        attribute = "${node.datacenter}"
   140        weight    = 50
   141  
   142        target "dc1" {
   143          percent = 50
   144        }
   145  
   146        target "dc2" {
   147          percent = 25
   148        }
   149  
   150        target "dc3" {
   151          percent = 25
   152        }
   153      }
   154  
   155      stop_after_client_disconnect = "120s"
   156  
   157      task "binstore" {
   158        driver = "docker"
   159        user   = "bob"
   160        leader = true
   161        kind   = "connect-proxy:test"
   162  
   163        affinity {
   164          attribute = "${meta.foo}"
   165          value     = "a,b,c"
   166          operator  = "set_contains"
   167          weight    = 25
   168        }
   169  
   170        config {
   171          image = "hashicorp/binstore"
   172  
   173          labels {
   174            FOO = "bar"
   175          }
   176        }
   177  
   178        volume_mount {
   179          volume      = "foo"
   180          destination = "/mnt/foo"
   181        }
   182  
   183        restart {
   184          attempts = 10
   185        }
   186  
   187        logs {
   188          max_files     = 14
   189          max_file_size = 101
   190        }
   191  
   192        env {
   193          HELLO = "world"
   194          LOREM = "ipsum"
   195        }
   196  
   197        service {
   198          meta {
   199            abc = "123"
   200          }
   201  
   202          canary_meta {
   203            canary = "boom"
   204          }
   205  
   206          tags        = ["foo", "bar"]
   207          canary_tags = ["canary", "bam"]
   208          port        = "http"
   209  
   210          check {
   211            name         = "check-name"
   212            type         = "tcp"
   213            interval     = "10s"
   214            timeout      = "2s"
   215            port         = "admin"
   216            grpc_service = "foo.Bar"
   217            grpc_use_tls = true
   218  
   219            check_restart {
   220              limit           = 3
   221              grace           = "10s"
   222              ignore_warnings = true
   223            }
   224          }
   225        }
   226  
   227        resources {
   228          cpu    = 500
   229          memory = 128
   230  
   231          network {
   232            mbits = "100"
   233  
   234            port "one" {
   235              static = 1
   236            }
   237  
   238            port "two" {
   239              static = 2
   240            }
   241  
   242            port "three" {
   243              static = 3
   244            }
   245  
   246            port "http" {}
   247  
   248            port "https" {}
   249  
   250            port "admin" {}
   251          }
   252  
   253          device "nvidia/gpu" {
   254            count = 10
   255  
   256            constraint {
   257              attribute = "${device.attr.memory}"
   258              value     = "2GB"
   259              operator  = ">"
   260            }
   261  
   262            affinity {
   263              attribute = "${device.model}"
   264              value     = "1080ti"
   265              weight    = 50
   266            }
   267          }
   268  
   269          device "intel/gpu" {}
   270        }
   271  
   272        kill_timeout = "22s"
   273  
   274        shutdown_delay = "11s"
   275  
   276        artifact {
   277          source = "http://foo.com/artifact"
   278  
   279          options {
   280            checksum = "md5:b8a4f3f72ecab0510a6a31e997461c5f"
   281          }
   282        }
   283  
   284        artifact {
   285          source      = "http://bar.com/artifact"
   286          destination = "test/foo/"
   287          mode        = "file"
   288  
   289          options {
   290            checksum = "md5:ff1cc0d3432dad54d607c1505fb7245c"
   291          }
   292        }
   293  
   294        vault {
   295          policies = ["foo", "bar"]
   296        }
   297  
   298        template {
   299          source        = "foo"
   300          destination   = "foo"
   301          change_mode   = "foo"
   302          change_signal = "foo"
   303          splay         = "10s"
   304          env           = true
   305          vault_grace   = "33s"
   306        }
   307  
   308        template {
   309          source          = "bar"
   310          destination     = "bar"
   311          perms           = "777"
   312          left_delimiter  = "--"
   313          right_delimiter = "__"
   314        }
   315      }
   316  
   317      task "storagelocker" {
   318        driver = "docker"
   319  
   320        lifecycle {
   321          hook    = "prestart"
   322          sidecar = true
   323        }
   324  
   325        config {
   326          image = "hashicorp/storagelocker"
   327        }
   328  
   329        resources {
   330          cpu    = 500
   331          memory = 128
   332        }
   333  
   334        constraint {
   335          attribute = "kernel.arch"
   336          value     = "amd64"
   337        }
   338  
   339        vault {
   340          policies      = ["foo", "bar"]
   341          env           = false
   342          change_mode   = "signal"
   343          change_signal = "SIGUSR1"
   344        }
   345      }
   346  
   347      constraint {
   348        attribute = "kernel.os"
   349        value     = "linux"
   350      }
   351  
   352      meta {
   353        elb_mode     = "tcp"
   354        elb_interval = 10
   355        elb_checks   = 3
   356      }
   357    }
   358  }