Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Desktop for Windows cannot enable kubernetes with error x509: certificate signed by unknown authority

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

like image 548
Sienna Avatar asked Oct 17 '25 12:10

Sienna


1 Answers

Below work around can help you resolve your issue.

You can solve this by

  • Open ~.kube\config in a text editor
  • Replace https://kubernetes.docker.internal:6443 to https://localhost:6443
  • Try connecting again

From this issue

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

Attaching troubleshooting blog1, bolg2 for your reference.

like image 185
Sai Chandra Gadde Avatar answered Oct 20 '25 03:10

Sai Chandra Gadde