1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-28 14:10:04 +02:00
copilot/docker/frontend/etc/containerpilot.json5
2017-08-01 23:58:56 +01:00

131 lines
2.7 KiB
Plaintext

{
consul: 'localhost:8500',
jobs: [
{
name: 'consul-agent',
exec: ['/usr/local/bin/consul', 'agent',
'-data-dir=/data',
'-config-dir=/config',
'-log-level=err',
'-rejoin',
'-retry-join', '{{ .CONSUL | default "consul" }}',
'-retry-max', '10',
'-retry-interval', '10s'],
health: {
exec: '/usr/bin/curl -o /dev/null --fail -s http://localhost:8500',
interval: 5,
ttl: 25
},
restarts: 'unlimited'
},
{
name: "preStart",
exec: "/bin/reload-nginx.sh preStart",
when: {
source: 'consul-agent',
once: 'healthy'
},
},
{
name: 'cp-frontend',
port: {{.PORT}},
exec: 'nginx',
interfaces: ["eth0", "eth1"],
restarts: 'unlimited',
when: {
source: 'preStart',
once: 'exitSuccess'
},
health: {
exec: 'pstree nginx',
interval: 10,
ttl: 25
}
},
{
name: "onchange-api",
exec: "/bin/reload-nginx.sh onChange",
when: {
source: "watch.api",
each: "changed"
}
},
{
name: 'sensor_memory_usage',
exec: '/bin/sensors.sh memory',
timeout: '5s',
when: {
interval: '5s'
},
restarts: 'unlimited'
},
{
name: 'sensor_cpu_load',
exec: '/bin/sensors.sh cpu',
timeout: '5s',
when: {
interval: '5s'
},
restarts: 'unlimited'
},
{
name: 'sensor_disk_capacity',
exec: '/bin/sensors.sh diskcapacity',
timeout: '5s',
when: {
interval: '60s'
},
restarts: 'unlimited'
},
{
name: 'sensor_disk_usage',
exec: '/bin/sensors.sh diskusage',
timeout: '5s',
when: {
interval: '60s'
},
restarts: 'unlimited'
}
],
watches: [
{
name: 'api',
interval: 3
}
],
telemetry: {
port: 9090,
tags: ['op'],
metrics: [
{
namespace: 'frontend',
subsystem: 'memory',
name: 'percent',
help: 'Percentage of memory used',
type: 'gauge'
},
{
namespace: 'frontend',
subsystem: 'cpu',
name: 'load',
help: 'CPU load',
type: 'gauge'
},
{
namespace: 'frontend',
subsystem: 'disk',
name: 'capacity',
help: 'Disk capacity',
type: 'gauge'
},
{
namespace: 'frontend',
subsystem: 'disk',
name: 'usage',
help: 'Disk usage',
type: 'gauge'
}
]
}
}