Currently, our operator performs several direct calls to the Kubernetes API server to get and list various objects. Each direct call to the API server incurs network latency and consumes resources on the API server and etcd. Additionally, performing frequent reads against the API server risks hitting rate limits (HTTP 429) during heavy workloads.
Replace direct read operations (get and list) with the kube-rs Reflector. By establishing a background Watcher that keeps an in-memory cache of the resources, we can serve read requests locally.
Example of directl calls:
Currently, our operator performs several direct calls to the Kubernetes API server to get and list various objects. Each direct call to the API server incurs network latency and consumes resources on the API server and etcd. Additionally, performing frequent reads against the API server risks hitting rate limits (HTTP 429) during heavy workloads.
Replace direct read operations (get and list) with the kube-rs Reflector. By establishing a background Watcher that keeps an in-memory cache of the resources, we can serve read requests locally.
Example of directl calls: