Kubernetes fails to start when Docker Desktop starts, requires restart

I’ve searched and looked through active issues but wasn’t able to find any similar posts.

When I first start Docker Desktop the Kubernetes indicator stays yellow for a long time and finally fails to start, turning red.

Restarting Docker Desktop usually resolves the issue and then k8s runs fine after that.

I can’t seem to find any logs or error messages indicating why. I’m on Windows 11 with WSL2.

to solve this problem I went to the office docker website to find the solution, some guy posted some fixs below:

1,Many of us enabled WSL2 integration and install Ubuntu from MS Store after installing Docker Desktop (at least >= 4.7.1) and starting Kubernetes, and found Kubernetes failed to start and stuck, for me the cause was due to the ‘Ubuntu’ in MS Store defaults to Distro 22.04.X which I believe is not working well with Docker Desktop and its Kubernetes engine.
The solution:
run Windows Task Manager to end-task Docker Desktop
uninstall ‘Ubuntu’ which is version 22.04.X in Windows installed apps
run ‘wsl -l -v’ to look at existing status
run ‘wsl -t Ubuntu-22.04’ to terminate Distro ‘Ubuntu-22.04’
run ‘wsl --unregister Ubuntu-22.04’ to unregister it
from MS Store download and install Ubuntu-20.04
run wsl and initialize Ubuntu-20.04
run ‘wsl -s Ubuntu-20.04’ to set default to it
in Docker Desktop Settings/Resources/WSL integration enable it and set it to default WSL distro ‘Ubuntu-20.04’

 

2, The real problem seam to be the systemd boot, who’s been set by default since 22.04. in the /etc/wsl.conf
 
[boot]
systemd=true

If I put it in the ubuntu 20.04, I’ve have de kubernetes startup problem, and if I remove it from 22.04, the kubernetes start from it.

btw : also tested with 24.04

some one said the solution 2 works, I am working on it right now.

 

posted @ 2025-04-30 23:18  阿维net  阅读(19)  评论(0)    收藏  举报