glance-api+neutron-server: add raise_for_status method call to livenessProbe

Without it, the livenessProbe will accept error return codes (4xx, 5xx).
In our case it was causing problems in glance-api and this fix solved the
condition where glance-api, e.g. in cases of controller node restarts
during maintenance, raised this error:

socket.gaierror: [Errno -3] Temporary failure in name resolution

and glace-api container didn't work since then correctly, showing this:

"--- no python application found, check your startup logs for errors ---"

As for neutron-server, I haven't seen the same issue yet but as the
probe's command is the same as for glance-api the fix applies as well.

I tested both glance-api and neutron-server - they works fine with this
fix.

Change-Id: Ia9663a74a3fcdfe676362bc6bd7b72e69156cbb8
Signed-off-by: Ales Rothbauer <ales.rothbauer@prozeta.eu>
This commit is contained in:
Ales Rothbauer
2025-11-11 18:56:11 +01:00
parent eaefa01739
commit 6ce6afff2a
4 changed files with 15 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ exec:
command:
- python
- -c
- "import requests; requests.get('http://127.0.0.1:{{ $health_port }}{{ $health_path }}')"
- "import requests; r = requests.get('http://127.0.0.1:{{ $health_port }}{{ $health_path }}'); r.raise_for_status()"
{{- else }}
httpGet:
path: {{ $health_path }}

View File

@@ -18,7 +18,7 @@ exec:
command:
- python
- -c
- "import requests; requests.get('http://127.0.0.1:{{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')"
- "import requests; r = requests.get('http://127.0.0.1:{{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}'); r.raise_for_status()"
initialDelaySeconds: 30
{{- else }}
httpGet:
@@ -33,7 +33,7 @@ exec:
command:
- python
- -c
- "import requests; requests.get('http://127.0.0.1:{{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')"
- "import requests; r = requests.get('http://127.0.0.1:{{ tuple "network" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}'); r.raise_for_status()"
initialDelaySeconds: 30
{{- else }}
httpGet:

View File

@@ -0,0 +1,6 @@
---
glance:
- |
add raise_for_status method call to the livenessProbe command to properly
raise an error when return code is 4xx (client error) or 5xx (server error)
...

View File

@@ -0,0 +1,6 @@
---
neutron:
- |
add raise_for_status method call to the livenessProbe command to properly
raise an error when return code is 4xx (client error) or 5xx (server error)
...