watch of *v1.Pod ended with: too old resource version

9/8/2020

I updated my EKS from 1.16 to 1.17. All of sudden I started getting this error:

pkg/mod/k8s.io/client-go@v0.0.0-20180806134042-1f13a808da65/tools/cache/reflector.go:99: watch of *v1.Pod ended with: too old resource version

Checked on git and people were saying that's not an error but my question is how to stop getting these messages? I was not getting this message when I was having EKS 1.16?

Source.

-- Vikas Rathore
amazon-eks
kubernetes

1 Answer

4/26/2021

This is a community wiki answer. Feel free to expand it.

In short, there is nothing to worry about when encountering these messages. They mean that there are newer version(s) of the watched resource after the time the client API last acquired a list within that watch window. In other words: a watch against the Kubernetes API is timing out, and it is being restarted, which is a intended behavior.

You can also see that being mentioned here:

this is perfectly expected, no worries. The messages are several hours apart.

When nothing happens in your cluster, the watches established by the Kubernetes client don't get a chance to get refreshed naturally, and eventually time out. These messages simply indicate that these watches are being re-created.

and here:

these are nothing to worry about. This is a known occurrence in Kubernetes and is not an issue 0. The API server ends watch requests when they are very old. The operator uses a client-go informer, which takes care of automatically re-listing the resource and then restarting the watch from the latest resource version.

So answering your question:

my question is how to stop getting these messages

Simply, you don't because:

This is working as expected and is not going to be fixed.

-- WytrzymaƂy Wiktor
Source: StackOverflow