Docker Desktop Recovery¶
When Docker Desktop restarts on macOS (update, crash, or sleep/wake), it shuffles the IP addresses assigned to Kind containers. This breaks /etc/hosts resolution, ingress routing, kubeconfig, and Backstage.
The recover-docker-restart.sh script automates the full recovery sequence.
Symptoms¶
After Docker Desktop restarts you may see:
curl http://backstage.idp.local→Could not resolve hostkubectl get pods→Unable to connect to the server- ArgoCD, Grafana, Prometheus — all returning
Connection refused - Kind nodes in
NotReadystate
Recovery¶
1 2 3 4 5 6 7 8 | |
What the script fixes¶
The script applies fixes in order:
| Step | Fix | Why |
|---|---|---|
| 1 | Patch kubelet.conf with the new API server IP |
Kind's API server IP changes on restart |
| 2 | Restart kindnet and kube-proxy DaemonSets |
Pod network routes become stale |
| 3 | Replace ingress-nginx pods |
Nginx binds to the old node IP at startup |
| 4 | Fix Grafana PVC permissions | chmod 700 on Grafana data subdirs (often reset after volume remount) |
| 5 | Patch Prometheus operator liveness probe | Operator may fail health checks on new IP |
| 6 | Restart Backstage Docker Compose stack | Backstage proxy config references cluster IP |
| 7 | Smoke-test all service URLs | Confirms recovery: Backstage, Grafana, ArgoCD, Prometheus, hello-service, and MCP servers |
Manual Recovery (if the script fails)¶
If recover-docker-restart.sh fails on a specific step, you can run that step manually:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Preventing IP Drift¶
Docker Desktop does not guarantee stable container IPs across restarts. There is no permanent fix, but you can reduce the frequency of disruption:
- Use Rancher Desktop (k3s) instead of Kind — Rancher Desktop uses a VM with a stable IP. Set
KUBERNETES_PROVIDER=rancher-desktopinlocal/.env. - Enable "Use Rosetta for x86/amd64 emulation" in Docker Desktop settings on Apple Silicon — this reduces the chance of crashes that trigger restarts.
- Prefer sleep over restart when taking breaks; sleep preserves container IPs.
Related¶
- Local Setup — initial cluster setup
- Runbooks: Kind Node IP Mismatch — deeper diagnosis for persistent IP-mismatch issues
- TROUBLESHOOTING — general troubleshooting checklist