Workspace marked unhealthy while bootstrap entrypoint is still running #22059
Replies: 1 comment 2 replies
|
I've hit this exact problem before. The workspace health check is kicking in before your bootstrap script finishes, so you need to tell Kubernetes to wait. Add an initialDelaySeconds to your bootstrap container's liveness/readiness probe that's longer than your bootstrap time. If you're not defining probes explicitly, the deployment is probably using defaults (like 0 initial delay), which is why it's marking unhealthy too early. Set something like initialDelaySeconds: 300 if your script can take up to 5 minutes. Also make sure the probes are pointing at something that won't exist until the Coder agent is actually running - maybe check /var/run/coder-agent.sock or whatever your agent exposes. That way the probe won't fire until the agent is ready, and the workspace won't flip unhealthy during bootstrap. |


I've hit this exact problem before. The workspace health check is kicking in before your bootstrap script finishes, so you need to tell Kubernetes to wait. Add an initialDelaySeconds to your bootstrap container's liveness/readiness probe that's longer than your bootstrap time. If you're not defining probes explicitly, the deployment is probably using defaults (like 0 initial delay), which is why it's marking unhealthy too early. Set something like initialDelaySeconds: 300 if your script can take up to 5 minutes. Also make sure the probes are pointing at something that won't exist until the Coder agent is actually running - maybe check /var/run/coder-agent.sock or whatever your agent exposβ¦