#3033·yarp

Use `WatchAsync` for the functions of both `ListAsync` and `WatchAsync` in `RunAsync` in YARP Kubernetes Ingress Controller

Author: Xulei-NLCreated May 27, 2026Updated Jun 8, 2026
LabelsType: IdeaKubernetes Ingress Controller

Introduction

The RunAsync in ResourceInformer.cs first invokes ListAsync to list all resources of a given type and then invokes WatchAsync to watch newly events. I recently found this blog Kubernetes v1.33: Streaming List responses and its feature state is beta.

What should we add or change to make your life better?

I'm wondering if we could refactor the current code to only use WatchAsync performing List + Watch, following the documentation https://kubernetes.io/docs/reference/using-api/api-concepts/#streaming-lists.

Why is this important to you?

We could make the code simplier by adopting the new Kubernetes's feature. In addition, for my own good, I learned C# and YARP along the way based on YARP's Ingress Controller implementation.

Caveat: The feature state is Beta. I'm not sure if we want to implement this before its state is GA.