{
"type": "MODIFIED",
"object": {
"kind": "Node",
"apiVersion": "v1",
"metadata": {
"name": "<REDACTED>", ...
},
"spec": { ...
},
"status": {
"capacity": { ...
},
"allocatable": { ...
},
"conditions": [
{
"type": "FilesystemCorruptionProblem",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-09T07:41:54Z",
"reason": "FilesystemIsOK",
"message": "Filesystem is healthy"
},
{
"type": "ContainerRuntimeProblem",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-10T20:37:25Z",
"reason": "ContainerRuntimeIsUp",
"message": "container runtime service is up"
},
{
"type": "KubeletProblem",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-10T20:37:25Z",
"reason": "KubeletIsUp",
"message": "kubelet service is up"
},
{
"type": "FrequentDockerRestart",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-09T07:41:54Z",
"reason": "NoFrequentDockerRestart",
"message": "docker is functioning properly"
},
{
"type": "FrequentUnregisterNetDevice",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-09T07:41:54Z",
"reason": "NoFrequentUnregisterNetDevice",
"message": "node is functioning properly"
},
{
"type": "VMEventScheduled",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-10T20:37:45Z",
"reason": "NoVMEventScheduled",
"message": "VM has no scheduled event"
},
{
"type": "ReadonlyFilesystem",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-09T07:41:54Z",
"reason": "FilesystemIsNotReadOnly",
"message": "Filesystem is not read-only"
},
{
"type": "FrequentContainerdRestart",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-09T07:41:54Z",
"reason": "NoFrequentContainerdRestart",
"message": "containerd is functioning properly"
},
{
"type": "KernelDeadlock",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-09T07:41:54Z",
"reason": "KernelHasNoDeadlock",
"message": "kernel has no deadlock"
},
{
"type": "FrequentKubeletRestart",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:10:59Z", <--- HERE
"lastTransitionTime": "2023-02-09T07:41:54Z",
"reason": "NoFrequentKubeletRestart",
"message": "kubelet is functioning properly"
},
{
"type": "MemoryPressure",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:15:15Z", <--- HERE
"lastTransitionTime": "2023-02-10T20:38:18Z",
"reason": "KubeletHasSufficientMemory",
"message": "kubelet has sufficient memory available"
},
{
"type": "DiskPressure",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:15:15Z", <--- HERE
"lastTransitionTime": "2023-02-10T20:38:18Z",
"reason": "KubeletHasNoDiskPressure",
"message": "kubelet has no disk pressure"
},
{
"type": "PIDPressure",
"status": "False",
"lastHeartbeatTime": "2023-02-27T08:15:15Z", <--- HERE
"lastTransitionTime": "2023-02-10T20:38:18Z",
"reason": "KubeletHasSufficientPID",
"message": "kubelet has sufficient PID available"
},
{
"type": "Ready",
"status": "True",
"lastHeartbeatTime": "2023-02-27T08:15:15Z", <--- HERE
"lastTransitionTime": "2023-02-10T20:38:18Z",
"reason": "KubeletReady",
"message": "kubelet is posting ready status. AppArmor enabled"
}
],
"addresses": [ ...
],
"daemonEndpoints": { ...
},
"nodeInfo": { ...
},
"images": [ ...
],
"volumesInUse": [ ...
],
"volumesAttached": [ ...
]
}
}
}
Setup
Observed in Filebeat 8.5.3 running in Azure Kubernetes
v1.24.6with the following autodiscover configuration:Details
Context
While addressing #23139 Node and Namespace watchers were added in Autodicover to make Node/Namespace metadata changes instantly available to the related Pods. Currently, when a Node modification is received via a watcher, all Pods located on this Node are retrieved from a watcher store (src) and stop and start Pod events are emitted (src). A single Pod can emit multiple start and stop events (src). This happens regardless of the nature of the change of the Node object.
In the environment specified in
Setupsection, it was observed that Node objects can be updated as frequently as every 10 seconds. Filebeat logs do not allow to determine what exactly was received via watch APIs, but this can be verified as follows:Node objects were modified in
.status.conditions[]array which is related to Node monitoring process. The only field modified waslastHeartbeatTime. Here's an example of message received via watch API:Details
As Node metadata is not modified, the entire configuration reload process that follows is unnecessary.
Here's an excerpt from Filebeat debug log that shows that every 10s a sequence of 4 stop and 4 start events is emitted, just for a single Pod (there are many Pods on a single Node, so this is multiplied):
With the above template configuration most of these start/stop should be ignored, but not events for Kibana Pods. Here is an interesting debug log excerpt which shows a sequence of stop and start events that lead to a runner error potentially caused by
loginput race condition (see #34388 (comment)). Once such runner error occurs Autodiscover worker initiates a configuration reload on every received event (src).Ultimately, the following frequency of configuration reloads was observed:
Enhancement request
Autodiscover should filter Node and Namespace object modifications that are not changing its metadata.
Workarounds
If
hintsare not used, Node and Namespace watchers can be disabled entirely (src) with the following configuration: