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.
This commit is contained in:
keyhan
2026-04-06 01:36:42 +03:30
parent dfdffca7ef
commit e646ac3689
+5 -4
View File
@@ -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,
},
},
],