File: Add-a-healtcheck-url.patch

package info (click to toggle)
nova 2%3A31.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 50,580 kB
  • sloc: python: 412,444; pascal: 1,845; sh: 992; makefile: 166; xml: 83
file content (53 lines) | stat: -rw-r--r-- 2,845 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 430a3de58c3e903fdd63a30bb54c6f367591f104 Mon Sep 17 00:00:00 2001
From: Thomas Goirand <zigo@debian.org>
Date: Thu, 30 Apr 2020 16:56:25 +0200
Subject: [PATCH] Add a /healthcheck URL

This is useful for operators to configure HAProxy and
for monitoring.

Change-Id: Ie735336d143ad38dc10bb8200f9d3b713e603503
---
 etc/nova/api-paste.ini | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: nova/etc/nova/api-paste.ini
===================================================================
--- nova.orig/etc/nova/api-paste.ini
+++ nova/etc/nova/api-paste.ini
@@ -6,7 +6,7 @@ use = egg:Paste#urlmap
 /: meta
 
 [pipeline:meta]
-pipeline = cors http_proxy_to_wsgi metaapp
+pipeline = healthcheck cors http_proxy_to_wsgi metaapp
 
 [app:metaapp]
 paste.app_factory = nova.api.metadata.handler:MetadataRequestHandler.factory
@@ -30,17 +30,22 @@ use = call:nova.api.openstack.urlmap:url
 
 [composite:openstack_compute_api_v21]
 use = call:nova.api.auth:pipeline_factory_v21
-keystone = cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler authtoken keystonecontext osapi_compute_app_v21
+keystone = healthcheck cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler authtoken keystonecontext osapi_compute_app_v21
 # DEPRECATED: The [api]auth_strategy conf option is deprecated and will be
 # removed in a subsequent release, whereupon this pipeline will be unreachable.
-noauth2 = cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler noauth2 osapi_compute_app_v21
+noauth2 = healthcheck cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler noauth2 osapi_compute_app_v21
 
 [composite:openstack_compute_api_v21_legacy_v2_compatible]
 use = call:nova.api.auth:pipeline_factory_v21
-keystone = cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler authtoken keystonecontext legacy_v2_compatible osapi_compute_app_v21
+keystone = healthcheck cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler authtoken keystonecontext legacy_v2_compatible osapi_compute_app_v21
 # DEPRECATED: The [api]auth_strategy conf option is deprecated and will be
 # removed in a subsequent release, whereupon this pipeline will be unreachable.
-noauth2 = cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler noauth2 legacy_v2_compatible osapi_compute_app_v21
+noauth2 = healthcheck cors http_proxy_to_wsgi compute_req_id faultwrap request_log sizelimit osprofiler noauth2 legacy_v2_compatible osapi_compute_app_v21
+
+[filter:healthcheck]
+use = egg:oslo.middleware#healthcheck
+backends = disable_by_file
+disable_by_file_path = /etc/nova/healthcheck_disable
 
 [filter:request_log]
 paste.filter_factory = nova.api.openstack.requestlog:RequestLog.factory