Minikube缓慢且无响应

时间:2019-05-27 14:19:00

标签: kubernetes minikube

今天,随机minikube似乎花很长时间才能通过kubectl响应命令。

偶尔甚至:

kubectl get pods 
Unable to connect to the server: net/http: TLS handshake timeout

我该如何诊断?

来自minikube logs的一些日志:

==> kube-scheduler <==
I0527 14:16:55.809859       1 serving.go:319] Generated self-signed cert in-memory
W0527 14:16:56.256478       1 authentication.go:387] failed to read in-cluster kubeconfig for delegated authentication: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory
W0527 14:16:56.256856       1 authentication.go:249] No authentication-kubeconfig provided in order to lookup client-ca-file in configmap/extension-apiserver-authentication in kube-system, so client certificate authentication won't work.
W0527 14:16:56.257077       1 authentication.go:252] No authentication-kubeconfig provided in order to lookup requestheader-client-ca-file in configmap/extension-apiserver-authentication in kube-system, so request-header client certificate authentication won't work.
W0527 14:16:56.257189       1 authorization.go:177] failed to read in-cluster kubeconfig for delegated authorization: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory
W0527 14:16:56.257307       1 authorization.go:146] No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.
I0527 14:16:56.264875       1 server.go:142] Version: v1.14.1
I0527 14:16:56.265228       1 defaults.go:87] TaintNodesByCondition is enabled, PodToleratesNodeTaints predicate is mandatory
W0527 14:16:56.286959       1 authorization.go:47] Authorization is disabled
W0527 14:16:56.286982       1 authentication.go:55] Authentication is disabled
I0527 14:16:56.286995       1 deprecated_insecure_serving.go:49] Serving healthz insecurely on [::]:10251
I0527 14:16:56.287397       1 secure_serving.go:116] Serving securely on 127.0.0.1:10259
I0527 14:16:57.417028       1 controller_utils.go:1027] Waiting for caches to sync for scheduler controller
I0527 14:16:57.524378       1 controller_utils.go:1034] Caches are synced for scheduler controller
I0527 14:16:57.827438       1 leaderelection.go:217] attempting to acquire leader lease  kube-system/kube-scheduler...
E0527 14:17:10.865448       1 leaderelection.go:306] error retrieving resource lock kube-system/kube-scheduler: Get https://localhost:8443/api/v1/namespaces/kube-system/endpoints/kube-scheduler?timeout=10s: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
E0527 14:17:43.418910       1 leaderelection.go:306] error retrieving resource lock kube-system/kube-scheduler: Get https://localhost:8443/api/v1/namespaces/kube-system/endpoints/kube-scheduler?timeout=10s: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
I0527 14:18:01.447065       1 leaderelection.go:227] successfully acquired lease kube-system/kube-scheduler
I0527 14:18:29.044544       1 leaderelection.go:263] failed to renew lease kube-system/kube-scheduler: failed to tryAcquireOrRenew context deadline exceeded
E0527 14:18:38.999295       1 server.go:252] lost master
E0527 14:18:39.204637       1 leaderelection.go:306] error retrieving resource lock kube-system/kube-scheduler: Get https://localhost:8443/api/v1/namespaces/kube-system/endpoints/kube-scheduler?timeout=10s: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
lost lease

更新: 要变通解决此问题,我只做了minikube deleteminikube start,性能问题就解决了。

1 个答案:

答案 0 :(得分:0)

找到解决方案后,我将其发布为Community Wiki,以供将来的用户使用。

1)通过添加-v标志并设置调试级别(0、1、2、3、7)来调试minikube的问题。

例如:minikube start --v=1设置为INFO级别。
更详细的信息here

2)使用日志命令minikube logs

3)因为Minikube在虚拟机上工作,有时最好删除minikube并重新启动它(在这种情况下很有帮助)。

minikube delete
minikube start

4)。由于资源不足,它可能会变慢。

Minikube默认使用2048MB内存和2个CPU。有关此问题的更多详细信息,请访问here 此外,您可以使用命令minikube start --cpus 4 --memory 8192

强制Minikue创建更多内容