flant / addon-operator

A system to manage additional components for Kubernetes cluster in a simple, consistent and automated way.
https://flant.github.io/addon-operator/
Apache License 2.0
483 stars 27 forks source link

Read resources from cache in resource monitor #386

Closed nabokihms closed 1 year ago

nabokihms commented 1 year ago

Overview

To check absent resources, use the kube-apiserver cache. It will reduce the amount of traffic between kube-apiserver and etcd and should reduce the kube-apiserver pressure.|

https://kubernetes.io/docs/reference/using-api/api-concepts/#semantics-for-get-and-list

What this PR does / why we need it

Objects in a release can be deployed to many different namespaces. For example, if the module is deployed within namespace with many secrets, e.g., helm secrets, addon-operator will constantly request them from etcd.

Special notes for your reviewer

Idle cluster difference

kube-apiserver ~400mb

image

etcd ~100mb (there is not much difference because there are not so many CRDs in the cluster) image