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:
@@ -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,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user