Add a /healthcheck URL

The /healthcheck is helpful for operators to setup zun-api
behind haproxy, or for doing monitoring.

Change-Id: Ibca14ebe606eb90e7b9af740f245604e97dd8cf1
This commit is contained in:
Hongbin Lu 2020-05-04 03:29:11 +00:00
parent 7130d65e9e
commit 767b04b1dc
2 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,9 @@
[pipeline:main]
[composite:main]
use = egg:Paste#urlmap
/: zun_api_pipeline
/healthcheck: healthcheck
[pipeline:zun_api_pipeline]
pipeline = cors request_id osprofiler authtoken api_v1
[app:api_v1]
@ -17,3 +22,8 @@ paste.filter_factory = oslo_middleware:RequestId.factory
[filter:cors]
paste.filter_factory = oslo_middleware.cors:filter_factory
oslo_config_project = zun
[app:healthcheck]
paste.app_factory = oslo_middleware:Healthcheck.app_factory
backends = disable_by_file
disable_by_file_path = /etc/zun/healthcheck_disable

View File

@ -9,6 +9,7 @@ namespace = oslo.db
namespace = oslo.log
namespace = oslo.messaging
namespace = oslo.middleware.cors
namespace = oslo.middleware.healthcheck
namespace = oslo.policy
namespace = oslo.privsep
namespace = oslo.service.periodic_task