for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Kubernetes does not complete startup, "Kubernetes is starting"

Open sundhaug92 opened this issue 8 years ago • 65 comments

Expected behavior

Kubernetes starts up

Actual behavior

Kubernetes gets stuck on "Kubernetes is starting"

Information

  • Diagnostic ID: 7F113F70-E430-4720-82B3-94080A1EA18B/2018-02-02_09-28-26
  • Windows 10 Pro 1709 (16299.192)
  • Docker CE 18.02.0-ce-rc1

Steps to reproduce the behavior

  1. Enable Kubernetes in the settings
  2. Wait

PS: I also enabled "Show system containers" but I'm not sure that's relevant

sundhaug92 avatar Feb 02 '18 08:02 sundhaug92

I'm sorry to ask, but the diagnostic upload seems to have failed. Could you perform another diag and give us the new ID ?

pgayvallet avatar Feb 02 '18 13:02 pgayvallet

Diagnostic ID 7F113F70-E430-4720-82B3-94080A1EA18B/2018-02-02_14-46-04

sundhaug92 avatar Feb 02 '18 13:02 sundhaug92

Thanks. The cluster initialisation apparently failed, but as the diag only contains log since last boot, and as the cluster initialisation was performed before that, I can't dig the root cause.

Could you go to options -> reset and click on the "reset kubernetes cluster" button, then wait like 2 minutes and perform a diagnostic again ?

pgayvallet avatar Feb 02 '18 15:02 pgayvallet

7F113F70-E430-4720-82B3-94080A1EA18B/2018-02-02_16-45-54

sundhaug92 avatar Feb 02 '18 15:02 sundhaug92

Same thing here. Diagnostic ID: 8F6907E3-A3D5-4FCC-A21F-82E769B3627D/2018-02-02_15-20-29

ghost avatar Feb 02 '18 17:02 ghost

same here. Diagnostic ID : B6B6D1F1-B2EA-4166-9375-41CA6D9E2308/2018-02-04_02-57-37

but after I quit docker then start it again, kubernetes related process start to show in docker ps but still got trouble when try to install kubernetes dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/alternative/kubernetes-dashboard.yaml

it said

Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

check one of kubernetes container log, it said

E0203 20:23:36.530181 1 leaderelection.go:224] error retrieving resource lock kube-system/kube-controller-manager: endpoints "kube-controller-manager" is forbidden: User "system:kube-controller-manager" cannot get endpoints in the namespace "kube-system" E0203 20:23:40.280810 1 leaderelection.go:224] error retrieving resource lock kube-system/kube-controller-manager: Get https://192.168.65.3:6443/api/v1/namespaces/kube-system/endpoints/kube-controller-manager: dial tcp 192.168.65.3:6443: getsockopt: connection refused

E0203 21:51:52.134405 1 leaderelection.go:224] error retrieving resource lock kube-system/kube-controller-manager: endpoints "kube-controller-manager" is forbidden: User "system:kube-controller-manager" cannot get endpoints in the namespace "kube-system" E0203 21:51:55.766586 1 leaderelection.go:224] error retrieving resource lock kube-system/kube-controller-manager: endpoints "kube-controller-manager" is forbidden: User "system:kube-controller-manager" cannot get endpoints in the namespace "kube-system"

funky81 avatar Feb 03 '18 19:02 funky81

Same here, reset the kubernetes cluster then uploaded the diagnostic 8B2338D2-D2E8-4FE0-88F2-F11341C8DDE9/2018-02-06_12-54-02

Adamyounger avatar Feb 06 '18 12:02 Adamyounger

Same problem for me: 2A62F543-1B98-41ED-848F-B6ADD1F84121/2018-02-06_14-09-45

jamct avatar Feb 06 '18 13:02 jamct

@sundhaug92 Thanks. kubelet starts, but then it's waiting for the api-server that apparently never booted correctly.

I see in the logs that the vm disk appears to be full ( [imageGCManager]: Disk usage on image filesystem is at 97% which is over the high threshold (85%). Trying to free 10230534963 bytes) which may explain why some pods never get ready.

Can you try increasing the disk size ? (docker's settings => advanced tab => disk size), and then restarting docker and re-resetting the cluster ? then if still failing, perform a diagnostic again.

pgayvallet avatar Feb 07 '18 14:02 pgayvallet

@funky81 or others : could you get me your logs of the kube-apiserver container ( enable "show system containers in the kubernetes tab, then docker ps | grep kube-apiserver-amd64 & docker logs on the id"

pgayvallet avatar Feb 07 '18 15:02 pgayvallet

@pgayvallet, even with "show system containers" enabled I never see any running containers after a docker ps -a, So no logs available :). All the docker images have been downloaded correctly (5 of them, gcr.io/google_containers/kube-controller-manager-amd64 etc), I also made sure I have enough room on vm disk. I have uploaded another diagnostic. 8B2338D2-D2E8-4FE0-88F2-F11341C8DDE9/2018-02-08_10-41-17

Adamyounger avatar Feb 08 '18 10:02 Adamyounger

@Adamyounger Strange. When I looked some of them would start but die and be removed

sundhaug92 avatar Feb 08 '18 10:02 sundhaug92

@pgayvallet here you go...for apiserver log

PS C:\Users\funky81-NSP> docker logs 55aeb4db63d1 I0208 21:00:09.795477 1 server.go:121] Version: v1.9.2 I0208 21:00:10.524050 1 feature_gate.go:184] feature gates: map[Initializers:true] I0208 21:00:10.524111 1 initialization.go:90] enabled Initializers feature as part of admission plugin setup I0208 21:00:10.538671 1 master.go:225] Using reconciler: master-count W0208 21:00:10.636045 1 genericapiserver.go:342] Skipping API batch/v2alpha1 because it has no resources. W0208 21:00:10.653318 1 genericapiserver.go:342] Skipping API rbac.authorization.k8s.io/v1alpha1 because it has no resources. W0208 21:00:10.655100 1 genericapiserver.go:342] Skipping API storage.k8s.io/v1alpha1 because it has no resources. W0208 21:00:10.672791 1 genericapiserver.go:342] Skipping API admissionregistration.k8s.io/v1alpha1 because it has no resources. [restful] 2018/02/08 21:00:10 log.go:33: [restful/swagger] listing is available at https://192.168.65.3:6443/swaggerapi [restful] 2018/02/08 21:00:10 log.go:33: [restful/swagger] https://192.168.65.3:6443/swaggerui/ is mapped to folder /swagger-ui/ [restful] 2018/02/08 21:00:11 log.go:33: [restful/swagger] listing is available at https://192.168.65.3:6443/swaggerapi [restful] 2018/02/08 21:00:11 log.go:33: [restful/swagger] https://192.168.65.3:6443/swaggerui/ is mapped to folder /swagger-ui/ I0208 21:00:16.559846 1 serve.go:89] Serving securely on [::]:6443 I0208 21:00:16.560128 1 controller.go:84] Starting OpenAPI AggregationController I0208 21:00:16.560241 1 apiservice_controller.go:112] Starting APIServiceRegistrationController I0208 21:00:16.560323 1 cache.go:32] Waiting for caches to sync for APIServiceRegistrationController controller I0208 21:00:16.560494 1 available_controller.go:262] Starting AvailableConditionController I0208 21:00:16.560562 1 cache.go:32] Waiting for caches to sync for AvailableConditionController controller I0208 21:00:16.562837 1 crdregistration_controller.go:110] Starting crd-autoregister controller I0208 21:00:16.563041 1 controller_utils.go:1019] Waiting for caches to sync for crd-autoregister controller I0208 21:00:16.579191 1 crd_finalizer.go:242] Starting CRDFinalizer I0208 21:00:16.825195 1 customresource_discovery_controller.go:152] Starting DiscoveryController I0208 21:00:16.825271 1 naming_controller.go:274] Starting NamingConditionController I0208 21:00:50.826604 1 trace.go:76] Trace[635183933]: "Create /api/v1/nodes" (started: 2018-02-08 21:00:16.8247981 +0000 UTC m=+7.213532901) (total time: 34.001706s): Trace[635183933]: [4.0012378s] [4.0009778s] About to store object in database Trace[635183933]: [34.001706s] [30.0004682s] END I0208 21:00:51.563766 1 trace.go:76] Trace[418361413]: "Create /api/v1/namespaces" (started: 2018-02-08 21:00:17.5617221 +0000 UTC m=+7.950502201) (total time: 34.0019625s): Trace[418361413]: [4.0014159s] [4.0013422s] About to store object in database Trace[418361413]: [34.0019625s] [30.0005466s] END E0208 21:00:51.564559 1 client_ca_hook.go:78] Timeout: request did not complete within allowed duration E0208 21:01:16.815815 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *rbac.ClusterRole: the server was unable to return a response in the time allotted, but may still be processing the request (get clusterroles.rbac.authorization.k8s.io) E0208 21:01:16.815956 1 reflector.go:205] k8s.io/kubernetes/vendor/k8s.io/kube-aggregator/pkg/client/informers/internalversion/factory.go:73: Failed to list *apiregistration.APIService: the server was unable to return a response in the time allotted, but may still be processing the request (get apiservices.apiregistration.k8s.io) E0208 21:01:16.816018 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *core.LimitRange: the server was unable to return a response in the time allotted, but may still be processing the request (get limitranges) E0208 21:01:16.816070 1 reflector.go:205] k8s.io/kubernetes/vendor/k8s.io/client-go/informers/factory.go:86: Failed to list *v1.Endpoints: the server was unable to return a response in the time allotted, but may still be processing the request (get endpoints) E0208 21:01:16.830955 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *rbac.ClusterRoleBinding: the server was unable to return a response in the time allotted, but may still be processing the request (get clusterrolebindings.rbac.authorization.k8s.io) E0208 21:01:16.832199 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *core.ResourceQuota: the server was unable to return a response in the time allotted, but may still be processing the request (get resourcequotas) E0208 21:01:16.832403 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *rbac.RoleBinding: the server was unable to return a response in the time allotted, but may still be processing the request (get rolebindings.rbac.authorization.k8s.io) E0208 21:01:16.832591 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *core.PersistentVolume: the server was unable to return a response in the time allotted, but may still be processing the request (get persistentvolumes) E0208 21:01:16.832656 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *core.ServiceAccount: the server was unable to return a response in the time allotted, but may still be processing the request (get serviceaccounts) E0208 21:01:16.834271 1 reflector.go:205] k8s.io/kubernetes/vendor/k8s.io/client-go/informers/factory.go:86: Failed to list *v1.Service: the server was unable to return a response in the time allotted, but may still be processing the request (get services) E0208 21:01:16.834372 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *core.Pod: the server was unable to return a response in the time allotted, but may still be processing the request (get pods) E0208 21:01:16.834579 1 reflector.go:205] k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/client/informers/internalversion/factory.go:73: Failed to list *apiextensions.CustomResourceDefinition: the server was unable to return a response in the time allotted, but may still be processing the request (get customresourcedefinitions.apiextensions.k8s.io) E0208 21:01:16.834707 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *storage.StorageClass: the server was unable to return a response in the time allotted, but may still be processing the request (get storageclasses.storage.k8s.io) E0208 21:01:16.834909 1 reflector.go:205] k8s.io/kubernetes/vendor/k8s.io/client-go/informers/factory.go:86: Failed to list *v1.Namespace: the server was unable to return a response in the time allotted, but may still be processing the request (get namespaces) E0208 21:01:16.835090 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *core.Secret: the server was unable to return a response in the time allotted, but may still be processing the request (get secrets) E0208 21:01:16.835599 1 reflector.go:205] k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/factory.go:85: Failed to list *rbac.Role: the server was unable to return a response in the time allotted, but may still be processing the request (get roles.rbac.authorization.k8s.io) E0208 21:01:17.583906 1 storage_rbac.go:175] unable to initialize clusterroles: the server was unable to return a response in the time allotted, but may still be processing the request (get clusterroles.rbac.authorization.k8s.io) I0208 21:01:21.566171 1 trace.go:76] Trace[2133304229]: "Create /api/v1/namespaces" (started: 2018-02-08 21:00:51.5652856 +0000 UTC m=+41.954033501) (total time: 30.0008373s): Trace[2133304229]: [30.0008373s] [30.0006547s] END E0208 21:01:21.567361 1 client_ca_hook.go:78] Timeout: request did not complete within allowed duration F0208 21:01:21.567413 1 hooks.go:188] PostStartHook "ca-registration" failed: unable to initialize client CA configmap: timed out waiting for the condition

funky81 avatar Feb 08 '18 21:02 funky81

For me, Windows firewall was blocking vpnkit.exe; resetting my Docker network settings had Windows prompt me to allow vpnkit.exe. Once allowed, performing "Settings > Reset > Reset Kubernetes Cluster" resolved this issue for me.

I will attempt to pull up any logs I can find to see what may have resulted in this state in the first place and whether vpnkit.exe is a red herring.

ghost avatar Feb 10 '18 05:02 ghost

# docker ps
CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS              PORTS               NAMES
69e38a7e72f7        gcr.io/google_containers/etcd-amd64        "etcd --listen-clien…"   29 seconds ago      Up 28 seconds                           k8s_etcd_etcd-docker-for-desktop_kube-system_7278f85057e8bf5cb81c9f96d3b25320_0
e442416fe5fd        gcr.io/google_containers/pause-amd64:3.0   "/pause"                 29 seconds ago      Up 28 seconds                           k8s_POD_kube-controller-manager-docker-for-desktop_kube-system_d44da25f7ce80f700f8d8b3b7ebeef60_0
70125bb929f4        gcr.io/google_containers/pause-amd64:3.0   "/pause"                 29 seconds ago      Up 28 seconds                           k8s_POD_kube-apiserver-docker-for-desktop_kube-system_c738ee9a2925624d2125f10019ebed8a_0
bc33d96f8238        gcr.io/google_containers/pause-amd64:3.0   "/pause"                 29 seconds ago      Up 28 seconds                           k8s_POD_etcd-docker-for-desktop_kube-system_7278f85057e8bf5cb81c9f96d3b25320_0
f333f50499bc        gcr.io/google_containers/pause-amd64:3.0   "/pause"                 29 seconds ago      Up 29 seconds                           k8s_POD_kube-scheduler-docker-for-desktop_kube-system_69c12074e336b0dbbd0a1666ce05226a_0
# etcd
2018-02-16 20:40:01.236797 I | etcdmain: etcd Version: 3.1.11
2018-02-16 20:40:01.236899 I | etcdmain: Git SHA: 960f4604b
2018-02-16 20:40:01.237138 I | etcdmain: Go Version: go1.8.5
2018-02-16 20:40:01.237154 I | etcdmain: Go OS/Arch: linux/amd64
2018-02-16 20:40:01.237159 I | etcdmain: setting maximum number of CPUs to 4, total number of available CPUs is 4
2018-02-16 20:40:01.242062 I | embed: listening for peers on http://localhost:2380
2018-02-16 20:40:01.242110 I | embed: listening for client requests on 127.0.0.1:2379
2018-02-16 20:40:01.248467 I | etcdserver: name = default
2018-02-16 20:40:01.248501 I | etcdserver: data dir = /var/lib/etcd
2018-02-16 20:40:01.248510 I | etcdserver: member dir = /var/lib/etcd/member
2018-02-16 20:40:01.248516 I | etcdserver: heartbeat = 100ms
2018-02-16 20:40:01.248522 I | etcdserver: election = 1000ms
2018-02-16 20:40:01.248527 I | etcdserver: snapshot count = 10000
2018-02-16 20:40:01.248538 I | etcdserver: advertise client URLs = http://127.0.0.1:2379
2018-02-16 20:40:01.248646 I | etcdserver: initial advertise peer URLs = http://localhost:2380
2018-02-16 20:40:01.248661 I | etcdserver: initial cluster = default=http://localhost:2380
2018-02-16 20:40:01.255380 I | etcdserver: starting member 8e9e05c52164694d in cluster cdf818194e3a8c32
2018-02-16 20:40:01.255417 I | raft: 8e9e05c52164694d became follower at term 0
2018-02-16 20:40:01.255430 I | raft: newRaft 8e9e05c52164694d [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
2018-02-16 20:40:01.255437 I | raft: 8e9e05c52164694d became follower at term 1
2018-02-16 20:40:01.377045 I | etcdserver: starting server... [version: 3.1.11, cluster version: to_be_decided]
2018-02-16 20:40:01.377709 I | etcdserver/membership: added member 8e9e05c52164694d [http://localhost:2380] to cluster cdf818194e3a8c32
2018-02-16 20:40:02.155856 I | raft: 8e9e05c52164694d is starting a new election at term 1
2018-02-16 20:40:02.155933 I | raft: 8e9e05c52164694d became candidate at term 2
2018-02-16 20:40:02.155949 I | raft: 8e9e05c52164694d received MsgVoteResp from 8e9e05c52164694d at term 2
2018-02-16 20:40:02.155983 I | raft: 8e9e05c52164694d became leader at term 2
2018-02-16 20:40:02.155995 I | raft: raft.node: 8e9e05c52164694d elected leader 8e9e05c52164694d at term 2
2018-02-16 20:40:02.156442 I | etcdserver: published {Name:default ClientURLs:[http://127.0.0.1:2379]} to cluster cdf818194e3a8c32
2018-02-16 20:40:02.156509 I | etcdserver: setting up the initial cluster version to 3.1
2018-02-16 20:40:02.156614 I | embed: ready to serve client requests
2018-02-16 20:40:02.156917 N | embed: serving insecure client requests on 127.0.0.1:2379, this is strongly discouraged!
2018-02-16 20:40:02.158936 N | etcdserver/membership: set the initial cluster version to 3.1
2018-02-16 20:40:02.159031 I | etcdserver/api: enabled capabilities for version 3.1

sundhaug92 avatar Feb 16 '18 20:02 sundhaug92

Finally i fixed this by write this command into Powershell with Admin Priv

[Environment]::SetEnvironmentVariable("KUBECONFIG", $HOME + ".kube\config", [EnvironmentVariableTarget]::Machine)

funky81 avatar Feb 19 '18 11:02 funky81

Strange, that works @funky81. Curious if that's the same underlying issue @winglerw28 hda underlying. Also, why isn't KUBECONFIG being set?

sundhaug92 avatar Feb 19 '18 11:02 sundhaug92

I dont know..well, after I set the path for KUBECONFIG, i can finally start kubernetes pods. And then got problem, and it's progress still starting right now

funky81 avatar Feb 19 '18 11:02 funky81

@funky81 I got it running now. Could it be that you're experiencing some of the other issues, such as VM storage-space? Might want to create a few separate issues for that. image

sundhaug92 avatar Feb 19 '18 11:02 sundhaug92

Noticing that kubernetes doesn't create KUBECONFIG if the folder is invalid. Btw, @funky81, should it not be .kube\config?

sundhaug92 avatar Feb 19 '18 11:02 sundhaug92