Manage resourceVersion to allow resilient restart of watch method
@brendandburns ya está trabajando en esto.
Desde el 3/3/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
What is the feature and why do you need it:
We are using the method stream of object Watch https://github.com/kubernetes-client/python/blob/94e42113a1fe5c580917decacdde879eab7406b3/kubernetes/base/watch/watch.py#L129.
Let say i use this method with v1.list_namespace with no timeout specified (https://github.com/kubernetes-client/python/blob/master/examples/watch/timeout-settings.md) then we see that:
- with no resourceVersion and timeout specified, the stream atfirst list all namespaces as 'ADDED' event the namespace are alphatically ordered.
- then the stream wait for event with a self.resource_version probably quite old
- we then hit a server timeout default kubernetes specified in the previous link between 30min and 1h then the watch and hit a 410.
- we need then to restart the stream
If during the 30min 1 hour period a namespace is created then the watch store a more recent resourceVersion and then the 410 is reached quite further in the time (probably depending of the history or activity on the cluster).
Describe the solution you'd like to see:
From our test the good resourceVersion to plan a restart is not the resourceVersion of the last event seen but the resourceVersion available in the metadata in the func argument of the stream metdhod func .
In the response there is a metadata.resourceVersion given by kubernetes that allow to restart the stream from this resourceVersion that generate no error.
Not sure if this metadata is available on all func method.
It's quite hard to understand how to use the watch method in the api if we want to maintain a daemon program with no error.
With a no resourceVersion and no timeout specified everyone should now that there is this kind of problem due to the self.resourceVersion storage
- Lenguaje dominante
- Python
- Estrellas
- 7.7k
- Forks
- 3.5k
- Merge medio
- 2 d 5 h
- PR fusionados (30 d)
- 24
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de kubernetes-client/python
-
kind/bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
kubernetes-client/python#2280 · 16 comentarios · 9 reacciones ·
-
Release 1.37 Abierto
kubernetes-client/python#2691 · 1 comentario · 1 reacción · 1 asignado ·
-
Growing library size Abiertohelp wanted
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
kubernetes-client/python#2677 · 13 comentarios · 1 reacción ·
-
help wanted kind/feature
kubernetes-client/python#2602 · 6 comentarios · 1 asignado ·
-
kind/bug
kubernetes-client/python#2596 · 13 comentarios · 2 reacciones · 1 asignado ·
Todos los issues de kubernetes-client/python
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
-
hcocena Abiertopolicies-accepted pre-review precheck-passed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Bioconductor/BiocContributions#214 · 5 comentarios ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
TencentCloud/Octop#1169 · 1 comentario ·
-
[开源推荐] 在老板拷问你之前,先让 AI 灵魂拷问你 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
521xueweihan/HelloGitHub#3778 ·
-
The version checker's trailing attribute region has no control for a less-than inside a quoted value Abiertoarea: dashboard area: tests bug perceived difficulty: 2 python
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Nitjsefnie-Harness-Commons/daedalus#1105 · 1 comentario ·