1

My Kubernetes cluster on docker for desktop on Mac is non responsive.

So I tried to reset Kubernetes as was suggested in delete kubernetes cluster on docker-for-desktop OSX The results are:

All Kubernetes resources are deleted Kubernetes restart hangs GUI to disable Kubernetes is grayed out and non responsive

I would like to avoid reseting docker so I can keep my image repository

How do I manually remove Kubernetes from docker VM?

Rubber Duck
  • 3,673
  • 3
  • 40
  • 59

4 Answers4

11

You can try disabling Docker Kubernetes in the settings file. You can find settings file in path ~/Library/Group\ Containers/group.com.docker/settings.json. Edit kubernetesEnabled property to false.

"kubernetesEnabled" : false,

I have ended up in situation where k8s is partly deleted and was not able to start docker. Restarting and/or changing this setting helped and did not delete images. I was not able to reproduce the situation later.

Also make sure you are running latest version of Docker.

Veikko
  • 3,372
  • 2
  • 21
  • 31
  • Changing this setting allows me to restart without kubernetes, but as soon as I enable it Kubernetes hangs – Rubber Duck Oct 17 '19 at 07:50
  • if you find that kubernetes app is always loading on Docker app, while the docker machine is already up and running, you can follow this suggestion and restart the app. Kubernetes will not then start and you can use minikube instead. – tepetrol Jun 02 '21 at 18:10
1

To remove the kuberntes cluster from docker desktop you need to run: rm -rf ~/.kube

mrded
  • 4,674
  • 2
  • 34
  • 36
0

How about this?

‚docker rm -f $(docker ps -aq)‘

This deletes and removes all containers.

Michael Johann
  • 455
  • 2
  • 8
0

I can't give you a technical answer that immediately fixes your problem, and this text is too long for a comment... but as someone who also had the same issue (couldn't disable k8s without a factory reset in Docker for Mac), my recommendation is:

Is it really worth for you to keep the image repository? Consider, what's a container? A program. It's not a VM. Would you backup your ls, ssh, vim... binaries when you want to initialize your OS? No right? But this is the same, you should view the container like another binary.

Odds here are that if you mess with manual actions, you will end up with a docker daemon in an undesired state. So, IMO, just go ahead and purge the Docker for Mac and start over, it's not really a big deal.

If you have tons of own images, you can build them right away. If you have tons of downloaded images, consider this as a good thing to do some cleaning. Also, notice that images work in layers, so if your images are correctly build leveraging the use of layers, the building process will be quite fast.

  • Some images take over an hour to build and Kubernetes hangs often with my container load. This is not a solution – Rubber Duck Oct 17 '19 at 08:07