From e646ac368987e154f0c663d11193edacaf6df98e Mon Sep 17 00:00:00 2001 From: keyhan Date: Mon, 6 Apr 2026 01:36:42 +0330 Subject: [PATCH] fix: switch health probes from HTTP /health to TCP socket check Most user apps (e.g. Next.js) don't have a /health endpoint, causing liveness/readiness probes to fail with 404 and crash-loop the pods. TCP socket probes just check if the port is open, which works universally. --- backend/src/kubernetes/kubernetes.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/src/kubernetes/kubernetes.service.ts b/backend/src/kubernetes/kubernetes.service.ts index 1f60ee5..45d591b 100644 --- a/backend/src/kubernetes/kubernetes.service.ts +++ b/backend/src/kubernetes/kubernetes.service.ts @@ -216,14 +216,15 @@ export class KubernetesService implements OnModuleInit { limits: { cpu: ctx.cpuLimit, memory: ctx.memoryLimit }, }, readinessProbe: { - httpGet: { path: '/health', port: ctx.port as any }, - initialDelaySeconds: 10, + tcpSocket: { port: ctx.port as any }, + initialDelaySeconds: 5, periodSeconds: 5, }, livenessProbe: { - httpGet: { path: '/health', port: ctx.port as any }, - initialDelaySeconds: 30, + tcpSocket: { port: ctx.port as any }, + initialDelaySeconds: 15, periodSeconds: 10, + failureThreshold: 5, }, }, ],