kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.31k stars 4.88k forks source link

apiServer not starting #14863

Closed ps68060 closed 1 year ago

ps68060 commented 2 years ago

What Happened?

I am new to minikube. I installed it last week and was able to "minikube start" but I was having issue deploying containers.

After lots of stop/start/delete cycles minikube wasn't able to start.

I have since tried "minikube delete", "delete --purge --all" and even uninstalled minikube and deleted anything I could find relating to it and re-installed it a few times.

minikube start fails every time. minikube status shows:

minikube status minikube type: Control Plane host: Running kubelet: Running apiserver: Stopped kubeconfig: Configured

The apiServer will not start.

Attach the log file

logs.txt

Operating System

Windows

Driver

Hyper-V

klaases commented 2 years ago

Hi @ps68060, are you still experiencing this issue? It seems that this may be in part why the issue is occurring, and persisting through re-installation:

Unfortunately, an error has occurred:
    timed out waiting for the condition

This error is likely caused by:
    - The kubelet is not running
    - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
    - 'systemctl status kubelet'
    - 'journalctl -xeu kubelet'

Have you tried restarting your computer after uninstalling?

/triage needs-information /kind support

ps68060 commented 2 years ago

I have tried several uninstall processes but I will try:

  1. Uninstall
  2. Reboot
  3. Reinstall
ps68060 commented 2 years ago

This has made things worse:

C:\WINDOWS\system32> minikube start

X Exiting due to GUEST_PROVISION: Failed to start host: creating host: create: precreate: no External vswitch nor Default Switch found. A valid vswitch must be available for this command to run. Check https://docs.docker.com/machine/drivers/hyper-v/

ps68060 commented 2 years ago

I uninstalled, rebooted and re-installed again twice and I am now back to the original issue where the first start of minikube gives:

minikube type: Control Plane host: Running kubelet: Running apiserver: Stopped kubeconfig: Misconfigured

minikube update-context

  • "minikube" context has been updated to point to www.xxx.yyy.zzz:8443
  • Current context is "minikube"

and

C:\WINDOWS\system32> minikube start

! Unable to restart cluster, will reset it: apiserver healthz: apiserver process never appeared

Unfortunately, an error has occurred: timed out waiting for the condition

This error is likely caused by:

If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:

Additionally, a control plane component may have crashed or exited when started by the container runtime. To troubleshoot, list all containers using your preferred container runtimes CLI. Here is one example how you may list all running Kubernetes containers by using crictl:

stderr: W0913 13:42:46.954757 9186 initconfiguration.go:120] Usage of CRI endpoints without URL scheme is deprecated and can cause kubelet errors in the future. Automatically prepending scheme "unix" to the "criSocket" with value "/var/run/cri-dockerd.sock". Please update your configuration! [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster To see the stack trace of this error execute with --v=5 or higher

ps68060 commented 2 years ago

I have updated to 1.27.0 and it is behaving the same.

stderr: W0921 10:52:50.926003 11907 initconfiguration.go:119] Usage of CRI endpoints without URL scheme is deprecated and can cause kubelet errors in the future. Automatically prepending scheme "unix" to the "criSocket" with value "/var/run/cri-dockerd.sock". Please update your configuration! W0921 10:52:50.931105 11907 utils.go:69] The recommended value for "resolvConf" in "KubeletConfiguration" is: /run/systemd/resolve/resolv.conf; the provided value is: /etc/kubelet-resolv.conf [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service' error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster To see the stack trace of this error execute with --v=5 or higher

ps68060 commented 2 years ago

Is it related to this issue ? https://github.com/kubernetes/minikube/issues/5451

5451

log20220923.txt

ps68060 commented 2 years ago

I believe I have managed to work around the issue by using an older version of kubernetes.

https://github.com/kubernetes/minikube/issues/14477

minikube start --kubernetes-version=v1.23.8

minikube status minikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configured

spowelljr commented 2 years ago

Hi @ps68060, this is related to the log This VM is having trouble accessing https://k8s.gcr.io/.

If you look at your docker logs you can see that it's continually failing to pull images as it has not internet connectivity, which is causing the start to fail:

Aug 26 08:47:47 minikube dockerd[946]: time="2022-08-26T08:47:47.139378400Z" level=warning msg="Error getting v2 registry: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:57760->172.20.224.1:53: i/o timeout"
Aug 26 08:47:47 minikube dockerd[946]: time="2022-08-26T08:47:47.139405700Z" level=error msg="Not continuing with pull after error: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:57760->172.20.224.1:53: i/o timeout"
Aug 26 08:47:47 minikube dockerd[946]: time="2022-08-26T08:47:47.139455400Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:57760->172.20.224.1:53: i/o timeout"
Aug 26 08:48:47 minikube dockerd[946]: time="2022-08-26T08:48:47.146308500Z" level=warning msg="Error getting v2 registry: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:43580->172.20.224.1:53: i/o timeout"
Aug 26 08:48:47 minikube dockerd[946]: time="2022-08-26T08:48:47.146336800Z" level=info msg="Attempting next endpoint for pull after error: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:43580->172.20.224.1:53: i/o timeout"
Aug 26 08:48:47 minikube dockerd[946]: time="2022-08-26T08:48:47.155022900Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:43580->172.20.224.1:53: i/o timeout"
Aug 26 08:49:07 minikube dockerd[946]: time="2022-08-26T08:49:07.148901500Z" level=warning msg="Error getting v2 registry: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:59581->172.20.224.1:53: i/o timeout"
Aug 26 08:49:07 minikube dockerd[946]: time="2022-08-26T08:49:07.148927100Z" level=error msg="Not continuing with pull after error: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:59581->172.20.224.1:53: i/o timeout"
Aug 26 08:49:07 minikube dockerd[946]: time="2022-08-26T08:49:07.148976700Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:59581->172.20.224.1:53: i/o timeout"
Aug 26 08:49:27 minikube dockerd[946]: time="2022-08-26T08:49:27.150867000Z" level=warning msg="Error getting v2 registry: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:49330->172.20.224.1:53: i/o timeout"
Aug 26 08:49:27 minikube dockerd[946]: time="2022-08-26T08:49:27.150894300Z" level=error msg="Not continuing with pull after error: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:49330->172.20.224.1:53: i/o timeout"
Aug 26 08:49:27 minikube dockerd[946]: time="2022-08-26T08:49:27.150944300Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get \"https://k8s.gcr.io/v2/\": dial tcp: lookup k8s.gcr.io on 172.20.224.1:53: read udp 172.20.226.222:49330->172.20.224.1:53: i/o timeout"

If you use the --container-runtime=containerd that should help with minikube starting, but you still won't be able to pull in any remote images. Are you using a proxy or VPN?

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

spowelljr commented 1 year ago

Hi @ps68060, we haven't heard back from you, do you still have this issue? There isn't enough information in this issue to make it actionable, and a long enough duration has passed, so this issue is likely difficult to replicate.

I will close this issue for now but feel free to reopen when you feel ready to provide more information.

TiagoIesbick commented 2 months ago

Run this: minikube update-context