Configuration File
Processes
The [[processes]]
section is used to define the different processes that make up your application. You can define multiple processes, such as a web server or a background worker.
Each process is defined as a separate [[processes]]
table.
# Configuration file with a processes section
app = 'myapp'
# App process
[[processes]]
name = 'app'
command = 'php artisan serve'
size = 'small'
[processes.http]
internal_port = 8080
[[processes.ports]]
port = 9090
protocol = 'tcp'
[[processes.ports]]
port = 53
protocol = 'udp'
[processes.autoscaling]
min_replicas = 1
max_replicas = 5
[[processes.autoscaling.metrics]]
resource = 'cpu'
avg_utilization = 70
[[processes.autoscaling.metrics]]
resource = 'memory'
avg_value = '512Mi'
[processes.liveness]
type = 'http'
path = '/up'
port = 8080
initial_delay_seconds = 30
timeout_seconds = 5
period_seconds = 10
success_threshold = 1
failure_threshold = 3
[processes.readiness]
type = 'tcp'
port = 9090
initial_delay_seconds = 40
timeout_seconds = 4
period_seconds = 8
success_threshold = 2
failure_threshold = 4
# Worker process
[[processes]]
name = 'worker'
command = 'php artisan queue:work'
[processes.resources]
[processes.resources.requests]
cpu = '500m'
memory = '256Mi'
[processes.resources.limits]
cpu = '1'
memory = '512Mi'
[processes.liveness]
type = 'exec'
command = 'php artisan health:check'
initial_delay_seconds = 20
timeout_seconds = 15
period_seconds = 30
success_threshold = 1
failure_threshold = 3
[processes.readiness]
type = 'exec'
command = 'php artisan health:check'
initial_delay_seconds = 22
timeout_seconds = 18
period_seconds = 32
success_threshold = 2
failure_threshold = 4
Common fields
name
: The name of the process.command
: The command to execute to start the process.size
: The size of the process. This is a predefined set of CPU and memory resources. If you need more control, you can use theresources
section instead.
Size | CPU | Memory |
---|---|---|
pico | 250m | 256Mi |
nano | 500m | 256Mi |
micro | 500m | 512Mi |
mini | 1000m | 512Mi |
small | 1000m | 1Gi |
medium | 2000m | 2Gi |
standard | 2000m | 4Gi |
large | 4000m | 8Gi |
xlarge | 4000m | 12Gi |
xxlarge | 6000m | 16Gi |
xxxlarge | 8000m | 32Gi |
processes.http
The [processes.http]
section exposes the process to the internet via HTTP. Only one process can have an http
section.
internal_port
: The port that the application is listening on inside the container.
processes.ports
The [[processes.ports]]
section allows you to expose additional ports for your process.
port
: The port to expose.protocol
: The protocol to use (tcp
orudp
).
processes.autoscaling
The [processes.autoscaling]
section allows you to configure autoscaling for your process.
min_replicas
: The minimum number of replicas.max_replicas
: The maximum number of replicas.metrics
: A list of metrics to use for autoscaling. You can usecpu
ormemory
.
processes.resources
The [processes.resources]
section allows you to specify the CPU and memory resources for your process.
requests
: The amount of resources that are guaranteed for the process.limits
: The maximum amount of resources that the process can use.
Health Checks
Deckrun uses liveness and readiness probes to check the health of your application.
liveness
: If the liveness probe fails, the container is restarted.readiness
: If the readiness probe fails, the container is removed from the service discovery, so it doesn't receive any more traffic.
Both probes have the same configuration options:
type
: The type of probe (http
,tcp
, orexec
).path
: The path to check (forhttp
probes).port
: The port to check (forhttp
andtcp
probes).command
: The command to execute (forexec
probes).initial_delay_seconds
: The number of seconds to wait before starting the probe.timeout_seconds
: The number of seconds after which the probe times out.period_seconds
: How often to perform the probe.success_threshold
: The minimum consecutive successes for the probe to be considered successful after having failed.failure_threshold
: The number of times that the probe is tried before considering it failed.