diff --git a/_data/docs.yml b/_data/docs.yml index 43d53d2..fa2f2bd 100644 --- a/_data/docs.yml +++ b/_data/docs.yml @@ -11,6 +11,8 @@ url: /docs/configuration/accessories/ - title: "Aliases" url: /docs/configuration/aliases/ + - title: "Anchors" + url: /docs/configuration/anchors/ - title: "Booting" url: /docs/configuration/booting/ - title: "Builders" diff --git a/docs/configuration/anchors.md b/docs/configuration/anchors.md new file mode 100644 index 0000000..3c48f6e --- /dev/null +++ b/docs/configuration/anchors.md @@ -0,0 +1,30 @@ +--- +title: Anchors +--- + +# Anchors + +You can re-use parts of your Kamal configuration by defining them as anchors and referencing them with aliases. + +For example, you might need to define a shared healthcheck for multiple worker roles. Anchors +begin with `x-` and are defined at the root level of your deploy.yml file. + +```yaml +x-worker-healthcheck: &worker-healthcheck + health-cmd: bin/worker-healthcheck + health-start-period: 5s + health-retries: 5 + health-interval: 5s +``` + +To use this anchor in your deploy configuration, reference it via the alias. + +```yaml +servers: + worker: + hosts: + - 867.53.0.9 + cmd: bin/jobs + options: + <<: *worker-healthcheck +```