-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathmongodb.nomad.hcl
58 lines (54 loc) · 1.35 KB
/
mongodb.nomad.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
variable "consul_namespace"{
description = "which consul namespace you want to deploy this job to"
default = "default"
}
job "mongodb" {
datacenters = ["eu-west-2a","eu-west-2b","eu-west-2c","eu-west-2","dc1"]
type = "service"
group "db" {
count = 1
consul{
namespace = var.consul_namespace
}
# volume "mongodb_vol" {
# type = "host"
# source = "mongodb_mount"
# }
network {
mode = "bridge"
port "db"{
static = 27017
}
}
task "mongodb" {
driver = "docker"
# volume_mount {
# volume = "mongodb_vol"
# destination = "/data/db"
# }
config {
image = "mongo"
ports = ["db"]
}
logs {
max_files = 5
max_file_size = 15
}
resources {
cpu = 500
memory = 512
}
env{
# CONSUL_HTTP_TOKEN="11a9a399-3f1d-b431-2a09-5e50e0ea3a02"
}
}
service {
name = "mongodb"
tags = ["mongodb"]
port = "db"
connect {
sidecar_service {}
}
}
}
}