This repository has been archived by the owner on Mar 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
containerpilot.json5
116 lines (116 loc) · 3.16 KB
/
containerpilot.json5
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
consul: "localhost:8500",
logging: {
level: "INFO",
format: "default",
output: "stdout"
},
jobs: [
//Events:
// healthy: emitted when the job's health check succeeds.
// unhealthy: emitted when the job's health check fails.
// exitSuccess: emitted when the process associated with the job exits with an exit code 0.
// exitFailed: emitted when the process associated with the job exits with a non-0 exit code.
// stopping: emitted when the job is asked to stop but before it does so. Useful when the job has a stop timeout.
// stopped: emitted when the job is stopped. Note that this is not the same as the process exiting because a job might have many executions of its process.
// startup: published to all jobs when ContainerPilot is ready to start.
// shutdown: published to all jobs when ContainerPilot is shutting down.
// changed: published when a watch sees a change in a dependency.
// enterMaintenance: published when the control plane is told to enter maintenance mode for the container. All jobs will be automatically deregistered from Consul when this happens, so you only want to react to this event if there is some other task to perform.
// exitMaintenance: published when the control plane is told to exit maintenance mode for the container.
//{
// a service that doesn't have a "when" field starts up on the
// global "startup" event by default
//name: "consul-agent",
// note we don't have a port here because we don't intend to
// advertise one to the service discovery backend
//exec: "consul -agent -join consul",
//restart: "always"
//},
{
name: "startup",
exec: "prestart.sh",
restarts: "never"
},
{
name: "redis",
exec: "su-exec redis:minemeld redis-server /etc/redis.conf",
restarts: "unlimited",
when: {
source: "startup",
once: "exitSuccess"
},
health: {
exec: "redis-healthcheck",
interval: 20,
ttl: 60,
timeout: "5s"
}
},
{
name: "collectd",
exec: "collectd -f",
restarts: "unlimited",
when: {
source: "rabbitmq",
once: "healthy"
},
health: {
exec: "collectd-healthcheck",
interval: 20,
ttl: 60,
timeout: "10s"
}
},
{
name: "rabbitmq",
exec: "rabbitmq-server",
restarts: "unlimited",
when: {
source: "startup",
once: "exitSuccess"
},
health: {
exec: "rabbitmq-healthcheck",
interval: 20,
ttl: 60,
timeout: "20s"
}
},
{
name: "minemeld",
exec: "su-exec minemeld: supervisord -n -c /opt/minemeld/supervisor/config/supervisord.conf --pidfile /var/run/minemeld/minemeld.pid",
restarts: "never",
stopTimeout: "60s",
when: {
source: "collectd",
once: "healthy"
},
health: {
exec: "supervisor-healthcheck",
interval: 20,
ttl: 60,
timeout: "20s"
}
},
{
name: "minemeld-shutdown",
exec: "supervisorctl -c /opt/minemeld/supervisor/config/supervisord.conf stop all",
stopTimeout: "30s",
restarts: "never",
when: {
source: "minemeld",
once: "stopping"
}
},
{
name: "web",
exec: "nginx",
restarts: "never",
when: {
source: "minemeld",
once: "healthy"
}
}
]
}