Fresh Docker Desktop Fails to enable Kubernetes

Total Newbie, working through the 2024 Edition of “The Kubernetes Book”. After installing docker desktop, I went to settings and attempted to enable Kubernetes which failed with the following errors:

oauth token: unexpected status from GET request to HTTPSREMOVEDREMOVED://auth.docker.io/token?scope=repository%3Adocker%2Fdesktop-vpnkit-controller%3Apull\\u0026service=registry.docker.io: 401 Unauthorized\"}\n{\"message\":\"starting kubernetes: pulling images: pulling from host: pulling tag \\\"docker/desktop-vpnkit-controller:dc331cb22850be0cdd97c84a9cfecaf44a1afb6e\\\": pulling image \\\"docker.io/docker/desktop-vpnkit-controller:dc331cb22850be0cdd97c84a9cfecaf44a1afb6e\\\": Error response from daemon: failed to resolve reference \\\"docker.io/docker/desktop-vpnkit-controller:dc331cb22850be0cdd97c84a9cfecaf44a1afb6e\\\": failed to authorize: failed to fetch oauth token: unexpected status from GET request to HTTPSREMOVEDREMOVED://auth.docker.io/token?scope=repository%3Adocker%2Fdesktop-vpnkit-controller%3Apull\\u0026service=registry.docker.io: 401 Unauthorized\"}\n{\"message\":\"starting kubernetes: pulling images: pulling from host: pulling tag \\\"docker/desktop-vpnkit-controller:dc331cb22850be0cdd97c84a9cfecaf44a1afb6e\\\": pulling image \\\"docker.io/docker/desktop-vpnkit-controller:dc331cb22850be0cdd97c84a9cfecaf44a1afb6e\\\": Error response from daemon: failed to resolve reference \\\"docker.io/docker/desktop-vpnkit-controller:dc331cb22850be0cdd97c84a9cfecaf44a1afb6e\\\": failed to authorize: failed to fetch oauth token: unexpected status from GET request to HTTPSREMOVEDREMOVED://auth.docker.io/token?scope=repository%3Adocker%2Fdesktop-vpnkit-controller%3Apull\\u0026service=registry.docker.io: 401 Unauthorized\"}\n"

The failures appear to be related to an authentication, based on the 401s. I attempted restarting docker desktop, and I am logged in. Is there something I’m missing? (I had to edit out some details in the error messages above, as it is only allowing me to include two URLS.

I am running on an M2 Mac, some details from terminal:

% docker --version                     
Docker version 27.2.0, build 3ab4256
% kubectl version --client=true -o yaml
clientVersion:
  buildDate: "2024-06-11T20:29:44Z"
  compiler: gc
  gitCommit: 39683505b630ff2121012f3c5b16215a1449d5ed
  gitTreeState: clean
  gitVersion: v1.30.2
  goVersion: go1.22.4
  major: "1"
  minor: "30"
  platform: darwin/arm64
kustomizeVersion: v5.0.4-0.20230601165947-6ce0bf390ce3

Any sugestions on how I could address this?

Thanks!

Please, share the output of

docker version

You only shared the Docker version, not the Docker Desktop version. The images that Docker Desktop tries to download for Kubernetes should not require authentication. Maybe there was something wrong with Docker Hub. Have you tried to manually pull the images using docker pull commands just to see if that works?

PS:: I edited your post to use code blocks. Please, read our formatting guide to be able to use it next time: How to format your forum posts

1 Like

Thanks for the breadcrumbs, I was able to address this issue on docker desktop 4.34.3 by executing the following:

% docker logout
% docker login
<returned a one time device authentication request which I completed via website>

It was much more clear that there was an issues with my authentication token when doing the pull via CLI as you suggested. I guess technically it was all there in the UI, but I didn’t put it all together.

Thank you sir and have a wonderful weekend.