akka-management
akka-management copied to clipboard
Allow embedding just health checks in an existing HTTP server
On GKE, if you define an Ingress for your application, this will configure the GCP load balancer to route to your app. If there is a readiness probe defined for your application, then the GCP load balancer will automatically be configured to use that, with no option to disable it, and as a consequence of that, the readiness probe must be served on the same port as the rest of your application, otherwise your Ingress will fail to deploy. This is described here:
Note that the Service exposed through an Ingress must point to the same container port on which the readiness probe is enabled.
Currently, it's possible to embed all management routes in an existing HTTP server, however, that's dangerous, potentially exposing the ability to down your cluster to the internet. The ability to embed just the health check routes in an existing HTTP server would alleviate this.
This is related to #599, but slightly different. That issue was a request to embed all routes in an existing server.
Or at least improve documentation as it doesn't show how to load all the routes and put them in your own route: https://doc.akka.io/docs/akka-management/current/healthchecks.html
Note that while at the moment it's straight forward to instantiate HealthCheckRoutes, this only works if you have a pure akka-http scaladsl application, because it only exposes the scaladsl routes. If you want to use it with gRPC for example, then you can't use the scaladsl routes because the akka-http scaladsl is not composable with partial functions.