mirror of
https://github.com/goauthentik/authentik
synced 2026-04-25 17:15:26 +02:00
root: Make health checks compatible with cloud platform load balancers (#10554)
* Change health checks to return HTTP 200. * Fix web.go check. * Only update docs. * update docs and add changelog entry Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@@ -36,14 +36,14 @@ class MetricsView(View):
|
||||
|
||||
|
||||
class LiveView(View):
|
||||
"""View for liveness probe, always returns Http 204"""
|
||||
"""View for liveness probe, always returns Http 200"""
|
||||
|
||||
def dispatch(self, request: HttpRequest) -> HttpResponse:
|
||||
return HttpResponse(status=204)
|
||||
return HttpResponse(status=200)
|
||||
|
||||
|
||||
class ReadyView(View):
|
||||
"""View for readiness probe, always returns Http 204, unless sql or redis is down"""
|
||||
"""View for readiness probe, always returns Http 200, unless sql or redis is down"""
|
||||
|
||||
def dispatch(self, request: HttpRequest) -> HttpResponse:
|
||||
try:
|
||||
@@ -56,4 +56,4 @@ class ReadyView(View):
|
||||
redis_conn.ping()
|
||||
except RedisError: # pragma: no cover
|
||||
return HttpResponse(status=503)
|
||||
return HttpResponse(status=204)
|
||||
return HttpResponse(status=200)
|
||||
|
||||
@@ -24,8 +24,8 @@ class TestRoot(TestCase):
|
||||
|
||||
def test_monitoring_live(self):
|
||||
"""Test LiveView"""
|
||||
self.assertEqual(self.client.get(reverse("health-live")).status_code, 204)
|
||||
self.assertEqual(self.client.get(reverse("health-live")).status_code, 200)
|
||||
|
||||
def test_monitoring_ready(self):
|
||||
"""Test ReadyView"""
|
||||
self.assertEqual(self.client.get(reverse("health-ready")).status_code, 204)
|
||||
self.assertEqual(self.client.get(reverse("health-ready")).status_code, 200)
|
||||
|
||||
@@ -89,7 +89,7 @@ func NewWebServer() *WebServer {
|
||||
}
|
||||
req.Header.Set("User-Agent", "goauthentik.io/router/healthcheck")
|
||||
res, err := ws.upstreamHttpClient().Do(req)
|
||||
if err == nil && res.StatusCode == 204 {
|
||||
if err == nil && res.StatusCode >= 200 && res.StatusCode < 300 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
@@ -6,7 +6,7 @@ authentik can be easily monitored in multiple ways.
|
||||
|
||||
## Server monitoring
|
||||
|
||||
Configure your monitoring software to send requests to `/-/health/live/`, which will return a `HTTP 204` response as long as authentik is running. You can also send HTTP requests to `/-/health/ready/`, which will return `HTTP 204` if both PostgreSQL and Redis connections can be/have been established correctly.
|
||||
Configure your monitoring software to send requests to `/-/health/live/`, which will return a `HTTP 200` response as long as authentik is running. You can also send HTTP requests to `/-/health/ready/`, which will return `HTTP 200` if both PostgreSQL and Redis connections can be/have been established correctly.
|
||||
|
||||
## Worker monitoring
|
||||
|
||||
|
||||
50
website/docs/releases/2024/v2024.8.md
Normal file
50
website/docs/releases/2024/v2024.8.md
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: Release 2024.8
|
||||
slug: "/releases/2024.8"
|
||||
---
|
||||
|
||||
:::::note
|
||||
2024.8 has not been released yet! We're publishing these release notes as a preview of what's to come, and for our awesome beta testers trying out release candidates.
|
||||
|
||||
To try out the release candidate, replace your Docker image tag with the latest release candidate number, such as 2024.8.0-rc1. You can find the latest one in [the latest releases on GitHub](https://github.com/goauthentik/authentik/releases). If you don't find any, it means we haven't released one yet.
|
||||
:::::
|
||||
|
||||
## Breaking changes
|
||||
|
||||
- **Changed HTTP Healthcheck endpoints status code**
|
||||
|
||||
For increased compatibility, the `/-/health/live/` and `/-/health/ready/` endpoints return 200 HTTP Status codes for successful checks. Previously these endpoints returned 204, which means in most cases no changes are required.
|
||||
|
||||
## New features
|
||||
|
||||
## Upgrading
|
||||
|
||||
This release does not introduce any new requirements.
|
||||
|
||||
### docker-compose
|
||||
|
||||
To upgrade, download the new docker-compose file and update the Docker stack with the new version, using these commands:
|
||||
|
||||
```shell
|
||||
wget -O docker-compose.yml https://goauthentik.io/version/2024.8/docker-compose.yml
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
The `-O` flag retains the downloaded file's name, overwriting any existing local file with the same name.
|
||||
|
||||
### Kubernetes
|
||||
|
||||
Upgrade the Helm Chart to the new version, using the following commands:
|
||||
|
||||
```shell
|
||||
helm repo update
|
||||
helm upgrade authentik authentik/authentik -f values.yaml --version ^2024.8
|
||||
```
|
||||
|
||||
## Minor changes/fixes
|
||||
|
||||
<!-- _Insert the output of `make gen-changelog` here_ -->
|
||||
|
||||
## API Changes
|
||||
|
||||
<!-- _Insert output of `make gen-diff` here_ -->
|
||||
Reference in New Issue
Block a user