Closed ClimberBear closed 3 years ago
I have found that, maybe, this is a duplicated of 2990. But this appears as solved!
I have workarounded as:
rm -rf ~/Library/Group\ Containers/group.com.docker/pki/
rm -rf ~/.kube
And restarting docker
rm -rf ~/Library/Group\ Containers/group.com.docker/pki/
Fixed my issues!
Fixed my issues too ! Thanks.
Big Sur 11.0.1 Docker 2.5.0.1
I am running the same issue. From the console log, below 3 PIDs periodically generating below error messages.
com.docker.driver.amd64-linux: cannot get lease for master node: an error on the server ("") has prevented the request from succeeding (get leases.coordination.k8s.io docker-desktop)
com.docker.backend: external: POST /events 200 "DockerDesktopGo" ""
com.docker.vpnkit: HTTP proxy --> 108.177.97.82:443 Host:k8s.gcr.io:443 (Origin): Failed to connect to 108.177.97.82:443
OS: macOS Catalina 10.15.7 Docker desktop: 3.0.4(51218) Kubernetes: V1.19.3 Engine: 20.10.2
As an alternative to Docker for Mac's single Kubernetes you can use Docker for Mac to create a multi-node Kubernetes cluster with the Kubernetes feature disabled. Here's a tutorial https://habd.as/post/kubernetes-macos-k3s-k3d-rancher/
I have tried a lots of ways to try to let K8S running in my macOS, the below error message occurs all the time.
cannot get lease for master node: an error on the server ("") has prevented the request from succeeding (get leases.coordination.k8s.io docker-desktop)
I was fighting this issue for 2+ days and finally fixed the issue... my /etc/hosts file was corrupted/malformed (probably from some other application).
THE FIX
try running the command file -I /etc/hosts
you should see /etc/hosts: text/plain; charset=us-ascii
BUT i was getting /etc/hosts: application/octet-stream; charset=binary
which was preventing docker/k8s from properly reading it.
I edited/reset my hosts file to:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
then reset docker and BOOM up and running no problem!
I am running the same issue. From the console log, below 3 PIDs periodically generating below error messages.
com.docker.driver.amd64-linux: cannot get lease for master node: an error on the server ("") has prevented the request from succeeding (get leases.coordination.k8s.io docker-desktop)
com.docker.backend: external: POST /events 200 "DockerDesktopGo" ""
com.docker.vpnkit: HTTP proxy --> 108.177.97.82:443 Host:k8s.gcr.io:443 (Origin): Failed to connect to 108.177.97.82:443
OS: macOS Catalina 10.15.7 Docker desktop: 3.0.4(51218) Kubernetes: V1.19.3 Engine: 20.10.2
Same error here
I have tried a lots of ways to try to let K8S running in my macOS, the below error message occurs all the time.
cannot get lease for master node: an error on the server ("") has prevented the request from succeeding (get leases.coordination.k8s.io docker-desktop)
I am not able to do k8s working also. It's sad! I will need to try minikube instead.
@ClimberBear's solution up above at https://github.com/docker/for-mac/issues/5027#issuecomment-718076014 worked perfectly
@rs-renato use kind rather than minikube. Kind is like k8s in a container.
@ClimberBear's solution up above at #5027 (comment) worked perfectly
Tried many times, can not solve the problem in my docker-for-macos.
@benbendemo how have you installed Docker ?
@benbendemo how have you installed Docker ?
Installed by the dmg file downloaded from docker official website.
I also had the "cannot get lease for master node: an error on the server" issue and Kubernetes would not start from Docker Desktop. My /etc/hosts file was fine. I tried cleaning the .kube directory and all sorts of things. Finally, I uninstalled Docker Desktop, downloaded and re-installed it, increased the Docker resources and enabled Kubernetes - this worked.
I suspect in my particular case, some remnant of my past experiments with docker, kubernetes, minikube, etc. was interfering. Anyway, if all else fails, try a complete re-install of Docker Desktop.
I have found that, maybe, this is a duplicated of 2990. But this appears as solved!
I have workarounded as:
rm -rf ~/Library/Group\ Containers/group.com.docker/pki/ rm -rf ~/.kube
And restarting docker
This command fixed my issue (docker version 3.2.0)
rm -rf ~/Library/Group\ Containers/group.com.docker/pki/
Indeed: recreating %windir%\drivers\etc\hosts as a plain 'ASCI text' file and populating it with the following (plus what more I need for other purposes) overcame this (and the next) error:
127.0.0.1 docker-desktop
127.0.0.1 kubernetes.docker.internal
Hello , i am having exactly this same issue , but on a Windows 10 machine, installed docker desktop, and when i try installing Kubernetes, it says "Starting..." and stays there forever :) .
I have also tried resetting docker desktop to factory settings, I have also tried removing the following directory as suggested on some posts: c:\Users\claud\AppData\Local\Docker\pki>
(it seems when docker desktop starts up it recreates that directory again...)
None of these did not work unfortunately.
My docker desktop version is 3.2.1 Kubernetes version is v1.19.7
Only can repeat: ensuring the C:\Windows\system32\drivers\etc\hosts file is plain ascii overcame this problem for me.
Using cygwin 'file' command on it, it did say: UTF-8 Unicode (with BOM) text, with CRLF line terminators (Had done some modifications to this file in the past, still no idea what made it a unicode file). Not sure how to determine this file encoding using Windows' own utilities.
After recreating the file from scratch 'file' now says: ASCII text, with CRLF, LF line terminators ... and all is well.
I am seeing the same issue on macOS 11.2.3 (Big Sur) - none of the above suggestions worked.
Kubernetes: v1.19.7 Docker: v20.10.5
I ended up using the 'Clean / Purge data' option, which did work.
I did,
1. `rm -r ~/Library/Group\ Containers/group.com.docker/pki/`
2. `rm -r ~/.kube`
3. Navigate to docker icon --> Troubleshoot --> Clean / Purge data. (Thanks @crablab)
The same error shows at the beginning but after waiting for a few minutes you might find the cluster is running.
P.S. Make sure you can reach Google.
Is this issue getting priority attention? I'm blocked by it. I have no idea what triggered the problem; most likely an update to docker since the last time I used the local k8s. My version is now 3.2.2 (61853) with kubernetes v1.19.7.
cannot get lease for master node: an error on the server
Tried all the workarounds noted above: no amount of file-removing, updating /etc/hosts
or mouse-clicking in the purge / clean / restart sections of the UI will get it to launch any of the k8s containers. The docker ps
command reports nothing running. I get the same error each time.
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen
comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
Dunno if this should be closed since after the latest update my dev env is broken because docker desktop will not stop start nor reset k8s. Tired reinstalling, deleting the ~/.kube file. Probably should just use bare metal on a pi and not have to worry about forced updates breaking my env while I sleep.
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked
Expected behavior
I have activated Kubernetes marking Enable Kubernetes and Show system container in Kubernetes section of preferences. I expect to have kubernetes up & running
Actual behavior
Kubernetes shows "Starting" and never finish to start The log shows
repeating forever
Information
I have checked my docker is up to date I have checked localhost in /etc/hosts file is correct Restarting the Mac doesn't solve the problem I have found similar error in https://github.com/docker/for-mac/issues/2985, but, as commented, my hosts file is correct I have found similar error here https://github.com/AliyunContainerService/k8s-for-docker-desktop/issues/56 (reported as solved)