Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix machine_checks example error #1796

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions reference/configuration.html.markerb
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ You can use the same `machine_checks` section for HTTP services as for [`service
[http_services.machine_checks]
image = "curlimages/curl"
entrypoint = ["/bin/sh", "-c"]
command = ["curl", "$FLY_TEST_MACHINE_IP", "|", "grep", "Hello, World!"]
command = ["curl http://[$FLY_TEST_MACHINE_IP] | grep 'Hello, World!'"]
kill_signal = "SIGKILL"
kill_timeout = "5s"
```
Expand Down Expand Up @@ -662,13 +662,13 @@ Times are in milliseconds unless units are specified.

### `services.machine_checks`

Machine checks work a bit differently than the other checks. They run on each deploy, and if they fail, the deploy is stopped. A new Machine is spawned with the environment variable `FLY_TEST_MACHINE_IP` set to the IP address of the Machine being tested. This is useful for running integration tests on Machines before a deployment. Here's an example:
Machine checks work a bit differently than the other checks. They run on each deploy, and if they fail, the deploy is stopped. A new Machine is spawned with the environment variable `FLY_TEST_MACHINE_IP` set to the [6PN IPv6 address](/docs/networking/private-networking/#6pn-addresses-in-detail) of the Machine being tested. This is useful for running integration tests on Machines before a deployment. Here's an example:

```toml
[[services.machine_checks]]
image = "curlimages/curl"
entrypoint = ["/bin/sh", "-c"]
command = ["curl", "$FLY_TEST_MACHINE_IP", "|", "grep", "Hello, World!"]
command = ["curl http://[$FLY_TEST_MACHINE_IP] | grep 'Hello, World!'"]
kill_signal = "SIGKILL"
kill_timeout = "5s"
```
Expand Down