-
Notifications
You must be signed in to change notification settings - Fork 826
Live/ready checks and unattended upgrades #7880
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
81 changes: 81 additions & 0 deletions
81
17/umbraco-cms/fundamentals/setup/server-setup/health-probes.md
This file contains hidden or 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,81 @@ | ||
| --- | ||
| description: Use .NET health probe endpoints to monitor whether your Umbraco application is alive and ready to serve requests. | ||
| --- | ||
|
|
||
| # Health Probes | ||
|
|
||
| .NET includes a built-in [health checks](https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/monitor-app-health) middleware that exposes HTTP endpoints reporting whether an application is alive and functioning. Orchestrators, load balancers, and monitoring tools poll these endpoints to decide if an instance should receive traffic. | ||
|
|
||
| {% hint style="info" %} | ||
| These endpoints are infrastructure-level HTTP probes used by orchestrators and load balancers. They are different from the [Health Check dashboard](../../../extending/health-check/) in the backoffice, which validates Umbraco and website-specific best practices. | ||
| {% endhint %} | ||
|
|
||
| ## Overview | ||
|
|
||
| Umbraco builds on this middleware and exposes two health probe endpoints that reflect the current runtime state. These endpoints are available in Umbraco 17.3 and later. | ||
|
|
||
| ## Endpoints | ||
|
|
||
| | Endpoint | Behavior | | ||
| |---|---| | ||
| | `GET /umbraco/api/health/live` | Returns HTTP 200 if the process is responding. No checks run. | | ||
| | `GET /umbraco/api/health/ready` | Returns HTTP 200 when the site is running normally. Returns HTTP 503 when the site is not ready, for example, during startup or an unattended upgrade. | | ||
|
|
||
| Both endpoints are anonymous and bypass the maintenance-page re-route active during upgrades. | ||
|
|
||
| ## Configuring health probes | ||
|
|
||
| Use the endpoints above to configure liveness and readiness probes on your hosting platform. | ||
|
AndyButland marked this conversation as resolved.
|
||
|
|
||
| Examples for some common hosting environments are shown below. | ||
|
|
||
| ### Azure App Service | ||
|
|
||
| In the Azure Portal, navigate to your App Service and open **Monitoring > Health check**. Set the path to: | ||
|
|
||
| ``` | ||
| /umbraco/api/health/ready | ||
| ``` | ||
|
|
||
| Azure uses this path to determine whether the instance is healthy and should receive traffic. | ||
|
|
||
| ### Kubernetes | ||
|
AndyButland marked this conversation as resolved.
|
||
|
|
||
| ```yaml | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /umbraco/api/health/live | ||
| port: 8080 | ||
| initialDelaySeconds: 5 | ||
| periodSeconds: 10 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /umbraco/api/health/ready | ||
| port: 8080 | ||
| initialDelaySeconds: 5 | ||
| periodSeconds: 10 | ||
| ``` | ||
|
|
||
| ### Docker Compose | ||
|
|
||
| ```yaml | ||
| services: | ||
| umbraco: | ||
| image: my-umbraco-app | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8080/umbraco/api/health/ready"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 3 | ||
| start_period: 30s | ||
| ``` | ||
|
|
||
| ### Load balancers | ||
|
|
||
| Use the readiness probe path (`/umbraco/api/health/ready`) as the health check URL for your load balancer. The endpoint returns HTTP 503 while the site is upgrading. This causes the load balancer to stop routing traffic to that node until the upgrade completes. For more details on load-balanced setups, see [Umbraco in Load Balanced Environments](load-balancing/). | ||
|
|
||
| ## Related | ||
|
|
||
| * [Upgrade Unattended](../upgrading/upgrade-unattended.md) | ||
| * [Umbraco in Load Balanced Environments](load-balancing/README.md) | ||
| * [Running Umbraco in Docker](running-umbraco-in-docker.md) | ||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.