github.com/zhizhiboom/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/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 vault_token = "foo" 9 10 meta { 11 foo = "bar" 12 } 13 14 constraint { 15 attribute = "kernel.os" 16 value = "windows" 17 } 18 19 affinity { 20 attribute = "${meta.team}" 21 value = "mobile" 22 operator = "=" 23 weight = 50 24 } 25 26 spread { 27 attribute = "${meta.rack}" 28 weight = 100 29 target "r1" { 30 percent = 40 31 } 32 target "r2" { 33 percent = 60 34 } 35 } 36 37 update { 38 stagger = "60s" 39 max_parallel = 2 40 health_check = "manual" 41 min_healthy_time = "10s" 42 healthy_deadline = "10m" 43 progress_deadline = "10m" 44 auto_revert = true 45 canary = 1 46 } 47 48 task "outside" { 49 driver = "java" 50 51 config { 52 jar_path = "s3://my-cool-store/foo.jar" 53 } 54 55 meta { 56 my-cool-key = "foobar" 57 } 58 } 59 60 group "binsl" { 61 count = 5 62 63 restart { 64 attempts = 5 65 interval = "10m" 66 delay = "15s" 67 mode = "delay" 68 } 69 70 reschedule { 71 attempts = 5 72 interval = "12h" 73 } 74 75 ephemeral_disk { 76 sticky = true 77 size = 150 78 } 79 80 update { 81 max_parallel = 3 82 health_check = "checks" 83 min_healthy_time = "1s" 84 healthy_deadline = "1m" 85 progress_deadline = "1m" 86 auto_revert = false 87 canary = 2 88 } 89 90 migrate { 91 max_parallel = 2 92 health_check = "task_states" 93 min_healthy_time = "11s" 94 healthy_deadline = "11m" 95 } 96 97 affinity { 98 attribute = "${node.datacenter}" 99 value = "dc2" 100 operator = "=" 101 weight = 100 102 } 103 104 spread { 105 attribute = "${node.datacenter}" 106 weight = 50 107 target "dc1" { 108 percent = 50 109 } 110 target "dc2" { 111 percent = 25 112 } 113 target "dc3" { 114 percent = 25 115 } 116 } 117 118 119 task "binstore" { 120 driver = "docker" 121 user = "bob" 122 leader = true 123 124 affinity { 125 attribute = "${meta.foo}" 126 value = "a,b,c" 127 operator = "set_contains" 128 weight = 25 129 } 130 131 config { 132 image = "hashicorp/binstore" 133 134 labels { 135 FOO = "bar" 136 } 137 } 138 139 logs { 140 max_files = 14 141 max_file_size = 101 142 } 143 144 env { 145 HELLO = "world" 146 LOREM = "ipsum" 147 } 148 149 service { 150 tags = ["foo", "bar"] 151 canary_tags = ["canary", "bam"] 152 port = "http" 153 154 check { 155 name = "check-name" 156 type = "tcp" 157 interval = "10s" 158 timeout = "2s" 159 port = "admin" 160 grpc_service = "foo.Bar" 161 grpc_use_tls = true 162 163 check_restart { 164 limit = 3 165 grace = "10s" 166 ignore_warnings = true 167 } 168 } 169 } 170 171 resources { 172 cpu = 500 173 memory = 128 174 175 network { 176 mbits = "100" 177 178 port "one" { 179 static = 1 180 } 181 182 port "two" { 183 static = 2 184 } 185 186 port "three" { 187 static = 3 188 } 189 190 port "http" { 191 } 192 193 port "https" { 194 } 195 196 port "admin" { 197 } 198 } 199 } 200 201 kill_timeout = "22s" 202 203 shutdown_delay = "11s" 204 205 artifact { 206 source = "http://foo.com/artifact" 207 208 options { 209 checksum = "md5:b8a4f3f72ecab0510a6a31e997461c5f" 210 } 211 } 212 213 artifact { 214 source = "http://bar.com/artifact" 215 destination = "test/foo/" 216 mode = "file" 217 218 options { 219 checksum = "md5:ff1cc0d3432dad54d607c1505fb7245c" 220 } 221 } 222 223 vault { 224 policies = ["foo", "bar"] 225 } 226 227 template { 228 source = "foo" 229 destination = "foo" 230 change_mode = "foo" 231 change_signal = "foo" 232 splay = "10s" 233 env = true 234 vault_grace = "33s" 235 } 236 237 template { 238 source = "bar" 239 destination = "bar" 240 perms = "777" 241 left_delimiter = "--" 242 right_delimiter = "__" 243 } 244 } 245 246 task "storagelocker" { 247 driver = "docker" 248 249 config { 250 image = "hashicorp/storagelocker" 251 } 252 253 resources { 254 cpu = 500 255 memory = 128 256 iops = 30 257 } 258 259 constraint { 260 attribute = "kernel.arch" 261 value = "amd64" 262 } 263 264 vault { 265 policies = ["foo", "bar"] 266 env = false 267 change_mode = "signal" 268 change_signal = "SIGUSR1" 269 } 270 } 271 272 constraint { 273 attribute = "kernel.os" 274 value = "linux" 275 } 276 277 meta { 278 elb_mode = "tcp" 279 elb_interval = 10 280 elb_checks = 3 281 } 282 } 283 }