1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-15 07:40:07 +02:00
copilot/packages/cp-frontend/etc/containerpilot.json5

111 lines
2.4 KiB
Plaintext
Raw Normal View History

{
consul: 'localhost:8500',
jobs: [
{
name: 'build',
exec: 'yarn run build'
},
{
name: 'cp-frontend',
port: {{.PORT}},
exec: '../../node_modules/.bin/serve --single build --port {{.PORT}}',
when: {
source: 'build',
once: 'exitSuccess'
},
health: {
exec: '/usr/bin/curl -o /dev/null --fail -s http://localhost:{{.PORT}}',
interval: 2,
ttl: 5
},
tags: [
'traefik.backend=cp-frontend',
'traefik.frontend.rule=PathPrefix:/',
'traefik.frontend.entryPoints=http'
]
},
{
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'],
restarts: 'unlimited'
},
{
name: 'sensor_memory_usage',
2017-06-20 16:48:05 +03:00
exec: '/bin/sensors memory',
timeout: '5s',
when: {
interval: '5s'
},
restarts: 'unlimited'
},
{
name: 'sensor_cpu_load',
2017-06-20 16:48:05 +03:00
exec: '/bin/sensors cpu',
timeout: '5s',
when: {
interval: '5s'
},
restarts: 'unlimited'
},
{
name: 'sensor_disk_capacity',
2017-06-20 16:48:05 +03:00
exec: '/bin/sensors diskcapacity',
timeout: '5s',
when: {
interval: '60s'
},
restarts: 'unlimited'
},
{
name: 'sensor_disk_usage',
2017-06-20 16:48:05 +03:00
exec: '/bin/sensors diskusage',
timeout: '5s',
when: {
interval: '60s'
},
restarts: 'unlimited'
}
],
telemetry: {
port: 9090,
tags: ['op'],
metrics: [
{
namespace: 'cp_frontend',
subsystem: 'memory',
name: 'percent',
help: 'Percentage of memory used',
type: 'gauge'
},
{
namespace: 'cp_frontend',
subsystem: 'cpu',
name: 'load',
help: 'CPU load',
type: 'gauge'
},
{
namespace: 'cp_frontend',
subsystem: 'disk',
name: 'capacity',
help: 'Disk capacity',
type: 'gauge'
},
{
namespace: 'cp_frontend',
subsystem: 'disk',
name: 'usage',
help: 'Disk usage',
type: 'gauge'
}
]
}
}