-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi-sample-python.nomad
64 lines (54 loc) · 1.16 KB
/
api-sample-python.nomad
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
58
59
60
61
62
63
64
job "api-sample-python" {
region = "global"
datacenters = ["dc1"]
type = "service"
update {
stagger = "30s"
max_parallel = 2
}
group "api-sample" {
count = 3
network {
port "http" {}
}
task "server" {
driver = "docker"
config {
image = "jkugler/api-sample-python:20210504"
args = [ ":${NOMAD_PORT_http}" ]
ports = ["http"]
}
vault {
policies = ["db"]
change_mode = "signal"
change_signal = "SIGUSR1"
}
template {
data = <<EOT
{{ with secret "secret/data/db/config" }}
POSTGRES_USER="{{ .Data.data.user }}"
POSTGRES_PASSWORD="{{ .Data.data.pass | toJSON }}"
POSTGRES_HOST="{{ .Data.data.host }}"
POSTGRES_DB="{{ .Data.data.name }}"
{{ end }}
EOT
destination = "db.env"
env = true
}
service {
name = "api-sample-python"
port = "http"
tags = [
"jkugler",
"urlprefix-/",
]
check {
type = "http"
path = "/api"
interval = "10s"
timeout = "2s"
}
}
}
}
}