Introduction When a CI/CD deployment health check fails, the pipeline marks the deployment as failed and may trigger a rollback. This blocks releases and requires investigation to determine if the application is actually broken or just slow to start.

Symptoms - Pipeline error: "Health check failed after 300s timeout" - Error: "Deployment rollout status check failed" - Application returns 503 during startup - Deployment shows as failed but pods are running - Rollback automatically triggered

Common Causes - Health check timeout too short for application startup time - Database migrations blocking health check endpoint - Health check endpoint not implemented - Application stuck during initialization - Resource limits too low causing slow startup

Step-by-Step Fix 1. **Check application logs during deployment**: ```bash kubectl logs -l app=my-app --tail=50 --follow ```

  1. 1.Test health check endpoint manually:
  2. 2.```bash
  3. 3.curl -v http://<service-ip>/health
  4. 4.curl -v http://<service-ip>/ready
  5. 5.`
  6. 6.Increase deployment timeout in pipeline:
  7. 7.```yaml
  8. 8.# GitHub Actions
  9. 9.- name: Deploy
  10. 10.run: |
  11. 11.kubectl apply -f deployment.yaml
  12. 12.kubectl rollout status deployment/my-app --timeout=600s
  13. 13.`

Prevention - Set deployment timeout to 3x the typical startup time - Implement separate readiness and liveness endpoints - Use pre-stop hooks for graceful shutdown - Configure deployment strategy with maxSurge for zero-downtime - Monitor deployment success rate as a pipeline metric