Skip to content

Commit ae05a8c

Browse files
committed
Update kamal blog post to include health check info
1 parent d1a50f5 commit ae05a8c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

MyApp/_posts/2024-11-20_kamal-deploy-templates.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,23 @@ proxy:
5858
host: myapp.example.com # Your domain pointing to the same IP as your host
5959
```
6060
61+
### Health Checks
62+
63+
The template includes the use of ASP.NET Core Health Checks, that use the default Kamal path of `/up` to check if the application is running before deploying.
64+
65+
```csharp
66+
public class HealthCheck : IHealthCheck
67+
{
68+
public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken token = default)
69+
{
70+
// Perform health check logic here
71+
return HealthCheckResult.Healthy();
72+
}
73+
}
74+
```
75+
76+
Kamal checks this path before deploying your application, so you can add any custom health checks to this path to ensure your application is ready to receive traffic.
77+
6178
## GitHub Repository
6279

6380
With your application created and configured for deployment, you can create a new GitHub Repository and add the GitHub Actions Secret of `PRIVATE_SSH_KEY` which should be a separate SSH key for deployments that has access to your Linux host.

0 commit comments

Comments
 (0)