Open bittner opened 5 years ago
Hi, i think you can use the --need-app flag to force uWSGI to exit if no app is loaded (will be the default in 2.1 as dynamic apps will be disabled)
When is 2.1 planned to be released?
I think you can use either raw tcp connect to uwsgi port, or include https://github.com/m-messiah/uwget in the package and run that on some known endpoint and parse the result.
edit: I forked it to uwping, which checks for specific return code and you can install into your image and then use as Kubernetes liveness/readiness probe.
Here is what we use.
readinessProbe:
httpGet:
path: /health/
port: 9040
initialDelaySeconds: 6
timeoutSeconds: 1
We have https enabled and had to make an exception for /health/
SECURE_SSL_REDIRECT = True
# For GKE Health Check
SECURE_REDIRECT_EXEMPT = [
'^health/',
]
I am using https://github.com/andreif/uwsgi-tools
healthcheck:
test: ["CMD-SHELL", "uwsgi_curl -H 'X_FORWARDED_PROTO: https' localhost:8000 ${HOST}/healthcheck/"]
interval: 20s
timeout: 10s
retries: 15
start_period: 30s
I'm trying to come up with a suitable health check (for a OpenShift/Kubernetes
livenessProbe
andreadinessProbe
) for uWSGI. The configuration I'm using is:What I want to detect is when my Django application fails, hence a case like this:
Python exits due to some exception, but uwsgi keeps running. How can I detect this?
I found some hints on cluster health checks in the docs, but I'm not quite sure how to put that into practice. :worried:
Any hints?