I entered the vm using the following command:
docker run --rm -it --privileged --pid host nicolaka/netshoot nsenter --all -t 1
and Reset kubernetes while I was checking the output of
ps aux in the terminal (in the VM). I saw a kubeadm init command running and then stopping, so I copied the command out to ran manually, but I had to find out where I had to run it. I had the process ID from the
ps aux command output so I used the same nsenter command that I used to get into the VM, but in this case I had to use that ID instead of 1. Finally I realized that was actually the container that runs the Docker daemon. So I ran this command (in the VM)
ctr -n services.linuxkit task exec -t --exec-id test 02-docker sh
and executed the kubeadm command manually
kubeadm init --ignore-preflight-errors=all --config /etc/kubeadm/kubeadm.yaml
Eventually I got some error message like:
could not find officially supported version of etcd for Kubernetes 1.27.2, falling back to the nearest etcd version (3.5.7-0)
[kubelet-check] Initial timeout of 40s passed
So there is some kind of bug here. I don’t have more time today, but if you want, you can report this issue on GitHub referring to this forum topic.
I couldn’t start Kubernetes on macOS either, but at least some Kubernetes container could start, but not the API server.
» docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a745d2cb4251 97b0bebd519d "kube-controller-man…" 7 seconds ago Up 6 seconds k8s_kube-controller-manager_kube-controller-manager-docker-desktop_kube-system_861008677140df5bf14684241a098812_2
40d4eb129b1f registry.k8s.io/kube-scheduler "kube-scheduler --au…" 55 seconds ago Up 55 seconds k8s_kube-scheduler_kube-scheduler-docker-desktop_kube-system_42b55bbd22a41e1e397a84692d259b1e_0
5ace095a1553 registry.k8s.io/pause:3.9 "/pause" 3 minutes ago Up 3 minutes k8s_POD_kube-scheduler-docker-desktop_kube-system_42b55bbd22a41e1e397a84692d259b1e_0
f1affc3df026 registry.k8s.io/pause:3.9 "/pause" 3 minutes ago Up 3 minutes k8s_POD_kube-controller-manager-docker-desktop_kube-system_861008677140df5bf14684241a098812_0
0e0511e06147 registry.k8s.io/pause:3.9 "/pause" 3 minutes ago Up 3 minutes k8s_POD_kube-apiserver-docker-desktop_kube-system_8b71cd624d40d0ffecf5822890467a47_0
69bfdbcd8160 registry.k8s.io/pause:3.9 "/pause" 3 minutes ago Up 3 minutes k8s_POD_etcd-docker-desktop_kube-system_daab091f7b57c624d51aae7ab076cb00_0
docker logs k8s_kube-controller-manager_kube-controller-manager-docker-desktop_kube-system_861008677140df5bf14684241a098812_2
I1009 19:15:21.201935 1 serving.go:348] Generated self-signed cert in-memory
I1009 19:15:21.411977 1 controllermanager.go:178] Version: v1.25.9
I1009 19:15:21.411999 1 controllermanager.go:180] "Golang settings" GOGC="" GOMAXPROCS="" GOTRACEBACK=""
I1009 19:15:21.412657 1 secure_serving.go:210] Serving securely on 127.0.0.1:10257
I1009 19:15:21.412702 1 tlsconfig.go:240] "Starting DynamicServingCertificateController"
I1009 19:15:21.412776 1 dynamic_cafile_content.go:157] "Starting controller" name="request-header::/run/config/pki/front-proxy-ca.crt"
I1009 19:15:21.412776 1 dynamic_cafile_content.go:157] "Starting controller" name="client-ca-bundle::/run/config/pki/ca.crt"
F1009 19:15:39.276233 1 controllermanager.go:221] error building controller context: failed to wait for apiserver being healthy: timed out waiting for the condition: failed to get apiserver /healthz status: Get "https://192.168.65.4:6443/healthz": dial tcp 192.168.65.4:6443: connect: no route to host