From 767b04b1dc1d67ea3065276d7331f53fad8f21b0 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Mon, 4 May 2020 03:29:11 +0000 Subject: [PATCH] Add a /healthcheck URL The /healthcheck is helpful for operators to setup zun-api behind haproxy, or for doing monitoring. Change-Id: Ibca14ebe606eb90e7b9af740f245604e97dd8cf1 --- etc/zun/api-paste.ini | 12 +++++++++++- etc/zun/zun-config-generator.conf | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/etc/zun/api-paste.ini b/etc/zun/api-paste.ini index 58f7dfe5c..99e208f50 100644 --- a/etc/zun/api-paste.ini +++ b/etc/zun/api-paste.ini @@ -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 diff --git a/etc/zun/zun-config-generator.conf b/etc/zun/zun-config-generator.conf index f9aa89828..bd4649c51 100644 --- a/etc/zun/zun-config-generator.conf +++ b/etc/zun/zun-config-generator.conf @@ -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