Kubernetes does not survive Docker Desktop's restart

Hello,

Kind-based Kubernetes in Docker Desktop(DD) for Windows does not work after DD is restarted (either intentionally or as part of restart of the workstation).

Environment:

  • Host OS: Windows 11
  • Container runtime: Docker Desktop 4.63.0, WSL2-based, Kubernetes enabled
  • Kubernetes mode: kind, cluster shape: 3 nodes
  • Kubernetes version: 1.35.1

Steps to Reproduce:

  1. Create healthy Kubernetes environment in DD.
  2. Restart DD, or reboot Windows while Kubernetes is enabled.
  3. Let DD bring Kubernetes back up automatically.
  4. DD gets stuck on:
    Starting Kubernetes cluster
    Waiting for node to be ready
    
  5. Command kubectl get nodes fails with EOF against the local API endpoint. But ‘desktop-control-plane’ container is shown working.

Looking at ‘desktop-control-plane’ container logs and its system, it is visible that /var/lib/kubelet/config.yaml is missing and kubelet.service is not started. Also /etc/kubernetes/manifests/ is empty. There are some problems with mounting parts of filesystem during second start of the container’s system (after restart of DD). The obvious guess is that there are some files that are not persisted by kind(?) / WSL2(?).

This error has been reproduced in a few different Windows workstations (also Win10, also the newest DD).

Anyone experienced something like this and know what remedy can be applied?

Is it a typo? I assume you are using 4.83, not 4.63

No. It is 4.63.0
I haven’t checked this with newer versions, as I can’t install them.
Also, I only saw this similar error, but for Mac. It is said there, that 4.49.0 resolved it. IMO is not true for Windows.

I will try to find time to test it on Windows out of curiosity, but I don’t remember such an issue. to be honest I don’t even run Kubernetes often on Docker Desktop, just occasionally.

If there is no open issue for it, since you have a lot of information already learned during your debugging, you could open a ticket on the new GitHub repo where issues on all platforms are stored in one repo:

https://github.com/docker/desktop-feedback/issues

I see one “Kubernetes not starting” issue from february, but it was about kubeadm, not Kind

Inspired by your statement about version 4.83.0 I checked change log for the most recent versions and in version 4.82.0 found this note:

Fixed a bug where a Kubernetes kind cluster failed to start with a Failed to get API server port error after a Docker Desktop restart.

So, perhaps this will solve my problem. As for now, I am not able to verify it, I will have to wait to confirm this. Or maybe someone repeats with the most recent DD version short procedure that I described above and let me know?

Now I don’t know if I have the same problem, but has the same effect. Yesterday I used Kind in Docker Desktop to test something at work and today kubectl does not work from the host but works inside the desktop-control-plane container.

Since I have to continue with my task, I have to recreate the cluster, but I will report this too.