Skip to content

Commit bde621d

Browse files
committed
mgr/cephadm: adding health check endpoint for mgmt-gateway
Signed-off-by: Redouane Kachach <[email protected]>
1 parent 3d9b3f3 commit bde621d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/pybind/mgr/cephadm/templates/services/mgmt-gateway/external_server.conf.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ server {
4646
# add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'none'; require-trusted-types-for 'script'; frame-ancestors 'self';";
4747
{% endif %}
4848

49+
{% if spec.enable_health_check_endpoint %}
50+
location /health {
51+
return 200 'OK';
52+
add_header Content-Type text/plain;
53+
}
54+
{% endif %}
4955
{% if oauth2_proxy_url %}
5056
location /oauth2/ {
5157
proxy_pass {{ oauth2_proxy_url }};

src/pybind/mgr/cephadm/templates/services/mgmt-gateway/internal_server.conf.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ server {
99
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
1010
ssl_prefer_server_ciphers on;
1111

12+
{% if spec.enable_health_check_endpoint %}
13+
location /health {
14+
return 200 'OK';
15+
add_header Content-Type text/plain;
16+
}
17+
{% endif %}
1218
{% if dashboard_endpoints %}
1319
location /internal/dashboard {
1420
rewrite ^/internal/dashboard/(.*) /$1 break;

src/python-common/ceph/deployment/service_spec.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,7 @@ def __init__(self,
18041804
ssl_stapling_verify: Optional[str] = None,
18051805
ssl_protocols: Optional[List[str]] = None,
18061806
ssl_ciphers: Optional[List[str]] = None,
1807+
enable_health_check_endpoint: bool = False,
18071808
preview_only: bool = False,
18081809
unmanaged: bool = False,
18091810
extra_container_args: Optional[GeneralArgList] = None,
@@ -1849,6 +1850,7 @@ def __init__(self,
18491850
self.ssl_protocols = ssl_protocols
18501851
#: List of supported secure SSL ciphers. Changing this list may reduce system security.
18511852
self.ssl_ciphers = ssl_ciphers
1853+
self.enable_health_check_endpoint = enable_health_check_endpoint
18521854

18531855
def get_port_start(self) -> List[int]:
18541856
ports = []

0 commit comments

Comments
 (0)