AliyunContainerService / k8s-for-docker-desktop

为Docker Desktop for Mac/Windows开启Kubernetes和Istio。
https://yq.aliyun.com/articles/672675
4.96k stars 1.13k forks source link

M1 V1.21.5 Kubernetes一直starting #191

Open dongb83 opened 2 years ago

dongb83 commented 2 years ago

如下是我的Mac版本 image 如下是Docker Desktop中Kubernetes的版本 image Docker的版本和Daemon.json如下 image

k8s-for-docker-desktop 我使用的是v1.21.5的版本,运行./load_images.sh后没有docker/desktop-storage-provisioner和docker/desktop-vpnkit-controller ,是我手动下载的,不知道版本是不是匹配,请帮忙看下截图 image 我check一下enable kubernetes之后,一直是starting,等了很久以后变成了failed to start image 我docker ps -a了一下发现没有任何容器在运行 image 不知道我是不是中间有什么步骤遗漏了,还是我目前Mac都版本不支持?

Talbot3 commented 2 years ago

在日志文件/Users/lilisi/Library/Containers/com.docker.docker/Data/log/vm有如下提示:

LoopBackOff: \"back-off 5m0s restarting failed container=kube-controller-manager pod=kube-controller-manager-docker-desktop_kube-system(e569b29c778f62de29f383a9cd6709a9)\"" pod="kube-system/kube-controller-manager-docker-desktop" podUID=e569b29c778f62de29f383a9cd6709a9 [026:03:41:07.459][I] I0126 03:41:07.459231 2013 status_manager.go:566] "Failed to get status for pod" podUID=e569b29c778f62de29f383a9cd6709a9 pod="kube-system/kube-controller-manager-docker-desktop" error="Get \"https://vm.docker.internal:6443/api/v1/namespaces/kube-system/pods/kube-controller-manager-docker-desktop\": x509: certificate signed by unknown authority (possibly because of \"crypto/rsa: verification error\" while trying to verify candidate authority certificate \"kubernetes\")" [026:03:41:07.461][I] I0126 03:41:07.461132 2013 scope.go:111] "RemoveContainer" containerID="5b8aa643b4700a4175bd321e48e9605edca7e3d7a89d61ea320e2ffda447918e" [026:03:41:07.496][I] time="2022-01-26T03:41:07Z" level=info msg="checking kubernetes pods are running: [io.kubernetes.container.name=coredns io.kubernetes.container.name=kube-controller-manager io.kubernetes.container.name=kube-apiserver]" [026:03:41:07.515][I] E0126 03:41:07.515211 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:07.616][I] E0126 03:41:07.616236 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:07.718][I] E0126 03:41:07.717261 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:07.821][I] E0126 03:41:07.818917 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:07.926][I] E0126 03:41:07.922584 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:08.024][I] E0126 03:41:08.023068 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:08.124][I] E0126 03:41:08.123637 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:08.227][I] E0126 03:41:08.226474 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:08.329][I] E0126 03:41:08.327153 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:08.429][I] E0126 03:41:08.428408 2013 kubelet.go:2291] "Error getting node" err="node \"docker-desktop\" not found" [026:03:41:08.432][I] I0126 03:41:08.431968 2013 kubelet_node_status.go:71] "Attempting to register node" node="docker-desktop" [026:03:41:08.440][I] E0126 03:41:08.439172 2013 kubelet_node_status.go:93] "Unable to register node with API server" err="Post \"https://vm.docker.internal:6443/api/v1/nodes\": x509: certificate signed by unknown authority (possibly because of \"crypto/rsa: verification error\" while trying to verify candidate authority certificate \"kubernetes\")" node="docker-desktop"

pluone commented 2 years ago

退出docker, rm -rf ~/.kube 然后再进来试下

torchlightVincent commented 2 years ago

退出docker, rm -rf ~/.kube 然后再进来试下

果然删了就可以了,大佬能讲下是什么原因吗?

dappbujiujiu commented 2 years ago

退出docker, rm -rf ~/.kube 然后再进来试下

天呐。。 折腾了半天 应该早看见你这个消息。。。。 神了 感谢您

ghost commented 2 years ago

@pluone 我也可以了,大佬牛皮~~~~

drgonroot commented 11 months ago

我这边也遇到类似问题,目前是在.zshrc 文件增加 export KUBECONFIG=/Users/useheart/.kube/config。同时卸载docker,重新安装。版本为:docker Version 4.9.1 (81317) Kubernetes: v1.24.0