启动耗时过长导致 K8s 杀 Pod:健康检查超时?懒加载优化+并行 Bean 初始化实战
问题背景 在 Kubernetes 环境中,你是否遇到过这样的场景: Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 10s default-scheduler Successfully assigned myapp-xxx to node-xxx Normal Pulling 9s kubelet Pulling image "myapp:latest" Normal Pulled 5s kubelet Successfully pulled image "myapp:latest" in 4.2s Normal Created 5s kubelet Created container myapp Normal Started 5s kubelet Started container myapp Warning Unhealthy 0s kubelet Liveness probe failed: HTTP probe failed with statuscode:....