skip to Main Content

I am trying to enable kubernetes for Docker Desktop. Kubernetes is however failing to start.

My log file shows:

cannot get lease for master node: Get "https://kubernetes.docker.internal:6443/apis/coordination.k8s.io/v1/namespaces/kube-node-lease/leases/docker-desktop": x509: certificate signed by unknown authority: Get "https://kubernetes.docker.internal:6443/apis/coordination.k8s.io/v1/namespaces/kube-node-lease/leases/docker-desktop": x509: certificate signed by unknown authority

I have NO_PROXY env var set already, and my hosts file has
127.0.0.1 kubernetes.docker.internal at the end, as was suggested here

I appreciate any help

2

Answers


  1. Below work around can help you resolve your issue.

    You can solve this by

    From this issue

    • Reset Docker to factory settings
    • Quit Docker
    • Set the KUBECONFIG environment variable to %USERPROFILE%.kubeconfig
    • Restart Docker and enable Kubernetes (still took a few minutes to start)

    Attaching troubleshooting blog1, bolg2 for your reference.

    Login or Signup to reply.
  2. My solution :

    1. delete $HOME/.kube/config
    2. Restart Docker Desktop
    3. notice the $HOME/.kube/config is back and your kubectl should work

    I have multiple config* files in .kube directory – these stay intact

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search