From 78b408057c2ef0c0db78e3e2d1bd33fbe684bba2 Mon Sep 17 00:00:00 2001 From: Deep Koluguri Date: Wed, 24 Jun 2026 19:13:56 -0400 Subject: [PATCH] fix: health returns 200 for degraded, probe tolerant of optional services --- backend/src/routes/health.js | 3 ++- k8s/app.yaml | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/routes/health.js b/backend/src/routes/health.js index ddff301..257ea8d 100644 --- a/backend/src/routes/health.js +++ b/backend/src/routes/health.js @@ -102,7 +102,8 @@ router.get('/', async (req, res) => { }; } - const statusCode = health.status === 'ok' ? 200 : 503; + // Only return 503 if the server itself is broken — degraded means optional services are down + const statusCode = health.status === 'error' ? 503 : 200; res.status(statusCode).json(health); }); diff --git a/k8s/app.yaml b/k8s/app.yaml index 8bebd1a..8129d56 100644 --- a/k8s/app.yaml +++ b/k8s/app.yaml @@ -26,14 +26,16 @@ spec: httpGet: path: /health port: 3010 - initialDelaySeconds: 15 + initialDelaySeconds: 30 periodSeconds: 20 + failureThreshold: 5 readinessProbe: httpGet: path: /health port: 3010 - initialDelaySeconds: 5 + initialDelaySeconds: 15 periodSeconds: 10 + failureThreshold: 6 --- apiVersion: v1 kind: Service