acs-engine icon indicating copy to clipboard operation
acs-engine copied to clipboard

Reason why node is marked as NotReady

Open rushabhnagda11 opened this issue 9 years ago • 62 comments

Is this a request for help?: Yes

Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm) Kubernetes

What happened: Node is marked as NotReady and a cascading effect takes places on my k8s cluster

What you expected to happen:

How to reproduce it (as minimally and precisely as possible): Not sure

Anything else we need to know: In /var/log/kern.log of my k8s master server, I can see that one node has been marked as NotReady. Is there a reason logged somewhere as to why this was done? This is a recurring issue every few days.

rushabhnagda11 avatar Jun 24 '17 12:06 rushabhnagda11

Can you look up these log on the agents that are marked not ready and see if there are any details in there that might be helpful? cat /var/log/azure/cluster-provision.log sudo journalctl -u kubelet

JackQuincy avatar Jun 26 '17 18:06 JackQuincy

This just happened. A node is almost at random marked as NotReady by my master. However, I was also unable to ssh into my node when it was marked as notready. Could a very high CPU process be running on the node at this time? I'm using only a 2 core machine.

I've had a look at the logs on the node around this time, and there was nothing useful there. Can you tell me how to proceed from here

Jun 28 12:18:37 k8s-master-18420427-0 dockerd[22509]: I0628 12:18:37.775805 1 controller_utils.go:285] Recording status change NodeNotReady event message for node k8s-agentpool1-18420427-2

Jun 28 12:18:37 k8s-master-18420427-0 dockerd[22509]: I0628 12:18:37.775935 1 controller_utils.go:203] Update ready status of pods on node [k8s-agentpool1-18420427-2]

Jun 28 12:18:37 k8s-master-18420427-0 dockerd[22509]: I0628 12:18:37.776570 1 event.go:217] Event(api.ObjectReference{Kind:"Node", Namespace:"", Name:"k8s-agentpool1-18420427-2", UID:"6b8de3e3-04d8-11e7-9280-000d3af03aaf", APIVersion:"", ResourceVersion:"", FieldPath:""}): type: 'Normal' reason: 'NodeNotReady' Node k8s-agentpool1-18420427-2 status is now: NodeNotReady

rushabhnagda11 avatar Jun 28 '17 13:06 rushabhnagda11

I am seeing exactly this behavior as well, and this morning we had it on a small production cluster, consisting of 3 agent DS12_v2 machines, where two machines were taken out with NotReady status almost simultaneously, taking down the third in the wake of that, due to too many containers being run on it simlutaneously (THAT was our fault, the other, we don't think so).

Looking at the journalctl -u kubelet, I see that at one point, the kubelet starts to take down containers, but I can't understand why:

Jul 04 07:37:40 k8s-agentpool1-22420894-1 docker[1528]: I0704 07:37:40.506695    1772 server.go:740] GET /metrics: (83.688577ms) 200 [[Prometheus/1.7.1] 10.240.255.5:54372]
Jul 04 07:37:42 k8s-agentpool1-22420894-1 docker[1528]: I0704 07:37:42.423130    1772 kubelet.go:1797] SyncLoop (DELETE, "api"): "aurora-mobile-green-1188259835-v9lrd_default(79f859fc-
Jul 04 07:37:42 k8s-agentpool1-22420894-1 docker[1528]: I0704 07:37:42.423706    1772 docker_manager.go:1559] Killing container "0c2db2806017d231e7f2df23d477531d08fdae727904df6935f6780
Jul 04 07:37:42 k8s-agentpool1-22420894-1 docker[1528]: I0704 07:37:42.487155    1772 kubelet.go:1797] SyncLoop (DELETE, "api"): "auth-redis-3305003549-cdz0p_default(8e25d914-6070-11e7
Jul 04 07:37:42 k8s-agentpool1-22420894-1 docker[1528]: I0704 07:37:42.487681    1772 docker_manager.go:1559] Killing container "83d5e69f08d1dc7502d4f4cbee29e566924c816a3482312234c9d5c
Jul 04 07:37:42 k8s-agentpool1-22420894-1 docker[1528]: I0704 07:37:42.547828    1772 kubelet.go:1797] SyncLoop (DELETE, "api"): "auth-server-1912670786-4p2gx_default(55062242-608a-11e
J
(this goes on for quite a while)

It also DELETEs e.g. kube-dns and heapster, for no reason I can see.

I still have the logs for the machines, where should I look, what could I look for?

DonMartin76 avatar Jul 04 '17 13:07 DonMartin76

It may be related to #906, and that the kubelet thinks it has to evict pods for not responding. How could I see that? We increased the size of our NFS server to a DS3, and since then it hasn't occurred.

DonMartin76 avatar Jul 05 '17 06:07 DonMartin76

I can confirm this issue. It happens twice a day on a single machine, and my disk read graphs are through the roof. Still trying to figure what process is doing this.

rushabhnagda11 avatar Jul 05 '17 10:07 rushabhnagda11

@DonMartin76 We've had a similar issue yesterday. For us it seemed to be related to an Azure networking issue (Intermittent connection failures in VPN Gateway)

@JackQuincy Is there a way to externally monitor the reasons why a node is marked as NotReady?

bogdangrigg avatar Jul 05 '17 13:07 bogdangrigg

@colemickens @brendandburns Is there a way like @bogdangrigg is requesting?

JackQuincy avatar Jul 05 '17 18:07 JackQuincy

To add a case to that problem, i'm using ACS with K8S 1.7.5 and since 9 P.M, all my nodes are running randomly down, kubelet is stopping posting node status one after another.

Surprisingly, it happend on my three different clusters at the same time, take a look at my grafana monitoring status on the 3 different clusters :

1 - image

2 - image

3 - image

Is that linked to a possible Azure API connection problem ? Kubelet is stopping positing status because Azure API is unreachable for a while ?

Since the problem started at the same time on 3 different clusters it must be linked to something external to Kubernetes.

My clusters are not OOMed ou CPU overloaded :

image

See : https://github.com/kubernetes/kubernetes/issues/43516

theobolo avatar Oct 19 '17 22:10 theobolo

We are also facing similar issues since this morning/yesterday evening (GMT 20:30) on our production cluster. Fortunately, not all nodes go down at the same time (this time), but rather one after the other, so that the application is still stable.

bildschirmfoto 2017-10-20 um 08 47 26

Which logs would make sense to look into to find a possible cause for this behavior? kubectl get events does not render anything useful (just states the obvious).

Update: Checked journalctl -u kubelet, and there is not a single occurrence of NotReady in it. FWIW. In /var/log/azure/cluster-provision.log the last entry is from when we provisioned the cluster.

Update 2: I sifted through all available journalctl units, and couldn't find anything suspicious in any log which would correlate with the time of NotReady.

DonMartin76 avatar Oct 20 '17 06:10 DonMartin76

This behavior is continuing for the entire day right now; we will reprovision the cluster with acs-engine 0.8.0 this afternoon and see whether that helps. The cluster showing this behavior was created with acs-engine v0.5.0 for Kubernetes 1.7.2 three days ago.

DonMartin76 avatar Oct 20 '17 10:10 DonMartin76

@DonMartin76 I really don't want to use the "reprovision" solution since i deployed all my clusters just 1 week ago and since i've a full Production and criticals applications running right now ... Let me know about your tests Don should be great. :D

BTW all my clusters are still flaky ... Production / Staging / etc ...

edit : I used ACS engine v0.7.0 with Kubernetes 1.7.5 to deploy my clusters

theobolo avatar Oct 20 '17 10:10 theobolo

@theobolo Will let you know how it works out. We reprovision production every week with zero downtime deployments anyway, so it is not a huge issue to do it one time out of the ordinary for us.

Which region are you in? We are in North Europe.

DonMartin76 avatar Oct 20 '17 10:10 DonMartin76

Oh really every week ! Did you automate all the migration process ? like migrate Data Disks provisionned on Azure, DNS rules, ingress ? Because i've a lot of critical applications Kafka, Mongo etc etc. I'm able to migrate with 0 downtime too but i'm taking 1/2 day to do it on my Three clusters.

Because the only point where i'm struggling is migrate my managed Disks i opened an issue to ask if it's possible to mount a specific Managed Disk on a pod or a Deployment : https://github.com/Azure/acs-engine/issues/1484

theobolo avatar Oct 20 '17 11:10 theobolo

We halt some processing for the time of the provisioning, which does not affect the customer; and customer data is kept on Cosmos, which we can just use from both the "old" and "new" cluster.

We clone data disks to a backup resource group first, then clone them back into the new resource group, in short. Fully scripted. We don't use mounts of managed disks to Pods, but implement an NFS server which has them mounted to take the state out of the cluster completely (but we reprovision that thing as well).

Works for us, but YMMV.

Nodes are still flaky on the current production cluster (the 0.5.0 acs-engine and k8s 1.7.2 one) FWIW, and I have encountered some breaking changes going from 0.5.0 to 0.8.0 (Master nodes are tainted instead of cordoned, breaking our DaemonSets). Will get back with results as soon as the new cluster with 1.7.7 has taken over and has been running for a while.

DonMartin76 avatar Oct 20 '17 11:10 DonMartin76

Update: After an update to acs-engine 0.8.0, and Kubernetes 1.7.7, the problem still occurs.

2017-10-20 17:26:23 +0200 CEST   2017-10-20 16:02:53 +0200 CEST   10        k8s-agent-33434527-0                   Node                                                   Normal    NodeNotReady              controllermanager                 Node k8s-agent-33434527-0 status is now: NodeNotReady

Similar error messages cycle through for the other nodes as well, and there seem to be no apparent reasons. The nodes are available via ssh when remoting into them via the master as a jump host, and do not seem to lose the container workload either, except if the nodes aren't reachable for more than 5 minutes - which triggers an eviction by the master and they are rescheduled somewhere else.

I have no clue where to dig here.

More logs from kubectl get events --watch:

2017-10-20 17:34:14 +0200 CEST   2017-10-20 15:45:28 +0200 CEST   9         k8s-master-33434527-0   Node                Normal    NodeNotReady   controllermanager   Node k8s-master-33434527-0 status is now: NodeNotReady
2017-10-20 17:34:23 +0200 CEST   2017-10-20 16:08:30 +0200 CEST   10        k8s-monitor-33434527-1   Node                Normal    NodeNotReady   controllermanager   Node k8s-monitor-33434527-1 status is now: NodeNotReady
2017-10-20 17:34:39 +0200 CEST   2017-10-20 15:41:12 +0200 CEST   30        k8s-master-33434527-0   Node                Normal    NodeHasSufficientDisk   kubelet, k8s-master-33434527-0   Node k8s-master-33434527-0 status is now: NodeHasSufficientDisk
2017-10-20 17:34:39 +0200 CEST   2017-10-20 15:41:12 +0200 CEST   30        k8s-master-33434527-0   Node                Normal    NodeHasNoDiskPressure   kubelet, k8s-master-33434527-0   Node k8s-master-33434527-0 status is now: NodeHasNoDiskPressure
2017-10-20 17:34:39 +0200 CEST   2017-10-20 15:41:12 +0200 CEST   30        k8s-master-33434527-0   Node                Normal    NodeHasSufficientMemory   kubelet, k8s-master-33434527-0   Node k8s-master-33434527-0 status is now: NodeHasSufficientMemory
2017-10-20 17:34:39 +0200 CEST   2017-10-20 15:42:05 +0200 CEST   10        k8s-master-33434527-0   Node                Normal    NodeReady   kubelet, k8s-master-33434527-0   Node k8s-master-33434527-0 status is now: NodeReady
2017-10-20 17:34:47 +0200 CEST   2017-10-20 15:40:04 +0200 CEST   23        k8s-monitor-33434527-1   Node                Normal    NodeHasSufficientDisk   kubelet, k8s-monitor-33434527-1   Node k8s-monitor-33434527-1 status is now: NodeHasSufficientDisk
2017-10-20 17:34:47 +0200 CEST   2017-10-20 15:40:04 +0200 CEST   23        k8s-monitor-33434527-1   Node                Normal    NodeHasSufficientMemory   kubelet, k8s-monitor-33434527-1   Node k8s-monitor-33434527-1 status is now: NodeHasSufficientMemory
2017-10-20 17:34:47 +0200 CEST   2017-10-20 15:40:04 +0200 CEST   23        k8s-monitor-33434527-1   Node                Normal    NodeHasNoDiskPressure   kubelet, k8s-monitor-33434527-1   Node k8s-monitor-33434527-1 status is now: NodeHasNoDiskPressure
2017-10-20 17:34:47 +0200 CEST   2017-10-20 15:42:02 +0200 CEST   11        k8s-monitor-33434527-1   Node                Normal    NodeReady   kubelet, k8s-monitor-33434527-1   Node k8s-monitor-33434527-1 status is now: NodeReady

And you can see by the COUNT this has happened a lot of times since the cluster was created, which was just one to two hours ago - it goes to NodeNotReady and back to NodeReady again, repeatedly.

Update: The problem ceased Saturday morning (Oct 21st) at around 02:30 GMT, and hasn't occurred since. This strongly suggests it was a problem in some underlying Azure infrastructure, but it still is very worrying.

DonMartin76 avatar Oct 20 '17 15:10 DonMartin76

I think this may be the same as this issue: #220 - @theobolo Can you check your kube-controller-manager container logs (in the kube-system namespace) for FullDisruption messages? I have tons of those in my logs.

DonMartin76 avatar Oct 21 '17 06:10 DonMartin76

Hey @DonMartin76 my clusters are back to a normal state since 5 A.M this morning, no more NotReady > Ready switches.

Look at the Grafana kubelet metrics :

PRODUCTION : image

STAGING : image

Should confirms that was an Azure problem ... I'll take a look at my kube-controller-manager logs to confirm your toughts.

BTW thanks for having described your migration process, i should take a look to add a NFS layer for my apps.

theobolo avatar Oct 21 '17 10:10 theobolo

Same here, problems just ceased Saturday morning at around 0430 GMT. I opened a support ticket to try to find the root cause on this one; I will return with more information if they find something useful.

DonMartin76 avatar Oct 23 '17 07:10 DonMartin76

@DonMartin76 Same here, opened an Azure issue to find what was wrong ... 👍

theobolo avatar Oct 23 '17 08:10 theobolo

@theobolo Would you mind sharing the Azure region(s) your cluster(s) run on? Also North Europe, or somewhere else?

DonMartin76 avatar Oct 23 '17 08:10 DonMartin76