fix: health returns 200 for degraded, probe tolerant of optional services
Build Institutional Trader / build-and-deploy (push) Successful in 2m2s
Details
Build Institutional Trader / build-and-deploy (push) Successful in 2m2s
Details
This commit is contained in:
parent
911693da88
commit
78b408057c
|
|
@ -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);
|
res.status(statusCode).json(health);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,14 +26,16 @@ spec:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /health
|
path: /health
|
||||||
port: 3010
|
port: 3010
|
||||||
initialDelaySeconds: 15
|
initialDelaySeconds: 30
|
||||||
periodSeconds: 20
|
periodSeconds: 20
|
||||||
|
failureThreshold: 5
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /health
|
path: /health
|
||||||
port: 3010
|
port: 3010
|
||||||
initialDelaySeconds: 5
|
initialDelaySeconds: 15
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
|
failureThreshold: 6
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue