Kubernetes Stuck at Starting

Reading Time: < 1 minute

Microservice and containerization is the next future, at least when this article is written. Playing with docker is quite fun, deploying microservices as a container is also fun. After success creating .NETCore container (another topic, another day perhaps), it’s time to level up the game to use orchestrator.

First one I choose to play with is Kubernetes (K8) since it’s included in Docker Desktop for Windows (or MacOS). The setup was quite easy, just a few ticks on settings as shown.

In order to enable Kubernetes just enable it from settings and restart your Docker Desktop, it might take a while to download all the Kubernetes assets.

Enabling Kubernetes

Here comes the problem, and I think the problem happens only if you use and run container before activating Kubernetes (Kubernetes is activated later after a while you use container function). What happen is, Kubernetes stuck at starting endlessly.

My error info is:

cannot get lease for master node: an error on the server (“”) has prevented the request from succeeding (get leases.coordination.k8s.io docker-desktop)

For me, it is resolved by

  1. Shutdown Docker
  2. Delete pki folder in C:\Users\[username]\AppData\Local\Docker (or rm – rf ~/Library/Group Containers/group.com.docker/pki in mac)
  3. [Optional] Delete .kube folder in C:\Users\[username] (or rm -rf ~/.kube)
  4. Start Docker

My environment are

  • OS: Windows 10 Pro 1909 / macOS Big Sur (11.2.3)
  • Docker: Docker Desktop – Community 20.10.5
  • Kubernetes: v1.19.7
  • Virtualization on Windows: Hyper-V

Hope this helps, cheers 🍻

Facebooktwitterlinkedinmail