Validate the Kamal configuration giving useful warning on errors. Each section of the configuration has its own config class and a YAML file containing documented example configuration. You can run `kamal docs` to see the example configuration, and `kamal docs <section>` to see the example configuration for a specific section. The validation matches the configuration to the example configuration checking that there are no unknown keys and that the values are of matching types. Where there is more complex validation - e.g for envs and servers, we have custom validators that implement those rules. Additonally the configuration examples are used to generate the configuration documentation in the kamal-site repo. You generate them by running: ``` bundle exec bin/docs <kamal-site-checkout> ```
53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
# Roles
|
|
#
|
|
# Roles are used to configure different types of servers in the deployment.
|
|
# The most common use for this is to run a web servers and job servers.
|
|
#
|
|
# Kamal expects there to be a `web` role, unless you set a different `primary_role`
|
|
# in the root configuration.
|
|
|
|
# Role configuration
|
|
#
|
|
# Roles are specified under the servers key
|
|
servers:
|
|
|
|
# Simple role configuration
|
|
#
|
|
#
|
|
# This can be a list of hosts, if you don't need custom configuration for the role.
|
|
#
|
|
# You can set tags on the hosts for custom env variables (see kamal docs env)
|
|
web:
|
|
- 172.1.0.1
|
|
- 172.1.0.2: experiment1
|
|
- 172.1.0.2: [ experiment1, experiment2 ]
|
|
|
|
# Custom role configuration
|
|
#
|
|
# When there are other options to set, the list of hosts goes under the `hosts` key
|
|
#
|
|
# By default only the primary role uses Traefik, but you can set `traefik` to change
|
|
# it.
|
|
#
|
|
# You can also set a custom cmd to run in the container, and overwrite other settings
|
|
# from the root configuration.
|
|
workers:
|
|
hosts:
|
|
- 172.1.0.3
|
|
- 172.1.0.4: experiment1
|
|
traefik: true
|
|
cmd: "bin/jobs"
|
|
options:
|
|
memory: 2g
|
|
cpus: 4
|
|
healthcheck:
|
|
...
|
|
logging:
|
|
...
|
|
labels:
|
|
my-label: workers
|
|
env:
|
|
...
|
|
asset_path: /public
|
|
|