Replace Docker Desktop with Hyperkit
In my workstation[Mac], I have been using Docker Desktop and Minikube[Minikube is a utility you can use to run Kubernetes (k8s) on your local machine.]
Every time I start using the Docker Desktop it starts consuming high CPU, which was affecting my workstation performance.
My Mac activity monitor shows as below.
We have few more alternatives for Minikube to run in your local.
- Hyper-V, KVM
- Parallels, Podman
- VirtualBox (or) VMWare
Replacing Docker Desktop with Hyperkit will help you fix the performance issues.
To avoid system performance issues, we want to get rid of Docker Desktop, not Docker. Docker CLI will be useful.
Uninstall Docker Desktop
Goto Finder -> Applications -> Select Docker -> Right Click -> Move to Bin
Install Docker CommandLine
brew install docker
It installs Docker CLI, you can see the docker running status by running the below commands.
# docker info
Debug Mode: falseServer:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
It may show errors as we have not set the docker environment variables.
Set Docker environment variables
eval $(minikube -p minikube docker-env)
Check the docker running status.
# docker info
It shows docker running status with resource details. Also, it gives confirmation that the Docker CLI is working good.
HyperKit is an open-source hypervisor for macOS hypervisor, optimized for lightweight virtual machines and container deployment.
brew install hyperkit
Check the version to make sure it is installed correctly.
hyperkit -v 127
hyperkit: 0.20200908Homepage: https://github.com/docker/hyperkit
Try few docker commands to test.
# docker --help
# docker ps
# docker images
Lets start a Minikube K8s cluster using the hyperkit.
Kubernetes cluster using the Hyperkit driver
minikube start --driver=hyperkit😄 minikube v1.23.0 on Darwin 11.5.2
✨ Using the hyperkit driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🔄 Restarting existing hyperkit VM for "minikube" ...
🐳 Preparing Kubernetes v1.22.1 on Docker 20.10.8 ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: default-storageclass, storage-provisioner
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
Check nodes and pods using kubectl commands.
kubectl get nodes --context minikube
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane,master 3h56m v1.22.1----
kubectl get pods --context minikube -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-78fcd69978-5f4vx 1/1 Running 1 (5m35s ago) 3h59m
etcd-minikube 1/1 Running 1 (5m35s ago) 3h59m
kube-apiserver-minikube 1/1 Running 1 (5m35s ago) 3h59m
kube-controller-manager-minikube 1/1 Running 1 (5m35s ago) 3h59m
kube-proxy-lhpb6 1/1 Running 1 (5m35s ago) 3h59m
kube-scheduler-minikube 1/1 Running 1 (5m35s ago) 3h59m
storage-provisioner 1/1 Running 4 (6m5s ago) 3h59m
Thanks for reading.