New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cached controller-runtime client #2414
Comments
/touch |
@timebertt Should this issue be closed in favor of #2822? Or do you want to track this separately? |
We could keep this one open as it is also about refactoring the client usage in the extension library, which is not related to the feature gate. |
cc @acumino @shafeeqes @ary1992, it seems there is just a very small TODO left to get this issue closed. Maybe you can have a look when you are free :) |
/assign |
/assign |
/assign |
/close |
@acumino: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
How to categorize this issue?
/area quality networking cost
/kind enhancement
What would you like to be added:
In g/g we have an increasing number of API calls that are made via controller-runtime clients instead of using more efficient mechanisms like
Informers
orListers
.In our current implementation, these clients — no matter if for garden, seed, plant or shoot cluster — are not backed by a cache, which means, that every call will result in a direct call to the respective API server. Because most of these calls go to API servers that are not running on the same cluster / in the same "network" (e.g. to the garden cluster or to the (shooted) seed's API server) like the caller (mainly gardenlet), they contribute to "external" traffic, which is (highly) priced by cloud providers.
Also, there are many different places and mechanisms in our code, where and how we construct such ClientSets, ChartRenderes, ChartAppliers, RESTMappers and so on, and they are very short-lived (e.g often constructed only for a single operation and discarded after the operation has completed).
As we will probably introduce more and more API calls via controller-runtime clients (because it is less complicated to use and allows more generic constructs), we should refactor how we construct/retrieve those clients and equip them with a cache, so we can save unnecessary network traffic (costs).
Related to/part of #1953
Steps
#2822 tracks all steps for graduating the
CachedRuntimeClients
feature gate, but they can also be considered a part of this issue.These are steps/subtasks of this issue, that are not strictly required for or related to the graduation of the feature gate but rather general improvements regarding cached controller-runtime clients:
RESTMapper
creation and get rid of disk cached discovery clients (Harmonize RESTMapper creation, remove DiscoveryConfiguration #2415)Applier
,ChartRenderer
andChartApplier
creation (Harmonize Applier, ChartRenderer and ChartApplier creation #2417)pkg/client/kubernetes
(will be used by default, so this will result in a breaking change for all callerswill be put behind a feature gate, so we can disable it if we encouter some problems while running it in a productive system) (Use cached controller-runtime client #2449)ClientMap
) which can be used by all components/controllers to retrieve clients to arbitrary clusters in a harmonized way and which keeps track of all constructed clients (Use cached controller-runtime client #2449)ClientMap
(Use cached controller-runtime client #2449)kubernetes.Interface
wherever appropriate in favor of cached controller-runtime clientskubernetes.Interface.Kubernetes()
(i.e. client-go): Eliminate usages of generated client sets inkubernetes.Interface.Kubernetes()
#5754kubernetes.Interface.Garden{Core,SeedManagement,Operations}
(i.e. our own generated client sets): Drop unused generated clients #4592kubernetes.Interface.API{Registration,Extension}
: Drop unused generated clients #4592Try{Update,Patch}
,RetryOnConflict
,exponentialBackoff
in extensions library: EliminateTry{Update,Patch}*
#4799Try{Update,Patch}
,RetryOnConflict
,exponentialBackoff
in resource-manager code: EliminateTry{Update,Patch}*
#4799enable (cached) controller-runtime clients in gardener-apiserver admission pluginsEliminate unstructured requests in chart applier(rather compolete component refactorings will switch to typed requests, see ☂️-Issue for elimination of Helm charts in favor of Golang implementation #2754)The text was updated successfully, but these errors were encountered: