Interview Prep/Real-World Interview/Write-a-Kubernetes-manifest tasks

Fix the probe configuration that keeps restarting a slow-starting Java app.

IntermediateHands-onWrite-a-Kubernetes-manifest tasks
Answer

Broken:

livenessProbe:
  httpGet: { path: /actuator/health, port: 8080 }
  initialDelaySeconds: 5
  periodSeconds: 5
  failureThreshold: 3

Fixed:

startupProbe:
  httpGet: { path: /actuator/health/liveness, port: 8080 }
  periodSeconds: 5
  failureThreshold: 30        # up to 150s to start
livenessProbe:
  httpGet: { path: /actuator/health/liveness, port: 8080 }
  periodSeconds: 10
  failureThreshold: 3
readinessProbe:
  httpGet: { path: /actuator/health/readiness, port: 8080 }
  periodSeconds: 5

Key trick → The app needed about 60s to start, but liveness killed it after 20s, causing a CrashLoopBackOff. A startupProbe holds off liveness until the first success.

All Real-World Interview questions Roadmap: Interview readiness

More on Write-a-Kubernetes-manifest tasks