-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add optional support for k8s liveness and rediness probes #30
Comments
Since if the Liveness State of an application is broken, Kubernetes will try to solve that problem by restarting the application instance, the “liveness” probe should not depend on health checks for external systems. Also, since Kubernetes will not route traffic to an instance of the application that it's "readiness state" is unready, checking external systems must be made carefully by the application developers. The probes should return 200 if they the server is alive/ready and >=400 otherwise (or completely fail to repsonse). For more details on these probes, see https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/. Therefore I suggest:
WDYT? |
there's another problem. when the registration with the admin server fails, pyctuator does not serve actuator endpoints at all. this behavior leads to cascading restarts since the readiness probe fails with connection refused. |
I see, |
expected behavoir: exception is thrown much earlier |
Thanks, will look into this. |
Actually, assuming you run your flask application in a k8s pod too, I'm thinking if this might be a behavior of k8s. |
Curl times out after two minutes... |
Yes, I just tested it myself. |
How about connecting in the background? The service may be healthy without admin registration.... |
I agree that you don't want to block an application from starting because the monitoring system is down. Pyctuator is using the builtin Looking at I can make this a config parameter with a default that's much lower, maybe 10s. |
That‘d be great, thanks. |
Oh, just noticed we are discussing this hanging within the issue asking k8s probes. |
See https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-kubernetes-probes for how its done in spring-boot's actuator.
In high level, pyctuator should support telling k8s when an application/service is ready to serve requests (i.e. readiness probe) and if the application is alive (this is the liveness probe) - this is different from the health status returned by
/pyctuator/health
for two reasons:While actuator allow to configure additional checks to these probes, it is suggested that initially we'll provide default implementation that users can choose to use.
The text was updated successfully, but these errors were encountered: