-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from nickhammond/yml-anchors
Add a full example of using yml anchors
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters