# A slow-starting application is killed by its liveness probe before it finishes starting. What is the recommended fix?

Kubernetes, Hard (Expert), Troubleshooting. https://k8wiz.com/uquiz/a-slow-starting-application-is-killed-by-its-liveness-probe-before-it-finishes-starting-what-is-the-recommended-fix

- A. Set the liveness probe's failureThreshold to 0 to disable restarts
- B. Replace the liveness probe with a readiness probe on the same endpoint
- C. Set restartPolicy: Never so the kubelet stops restarting it
- D. Add a startupProbe that covers the slow start

**Answer:** Add a startupProbe that covers the slow start

**Explanation:** While a startupProbe is defined and hasn't succeeded yet, the kubelet doesn't run the liveness or readiness probes. Set failureThreshold times periodSeconds long enough to cover the slowest startup. After it succeeds, the liveness probe can stay strict for the rest of the container's life. A large initialDelaySeconds also works, but it delays failure detection on every start.
