krr icon indicating copy to clipboard operation
krr copied to clipboard

Add option to select object for which recommendations will be generated

Open agabrys opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

I work on a project where we have many different components in a one namespace. When I am interested with recommendation only for one of them, I can limit the tool to be executed only in a one namespace, but I cannot limit only to specific objects. The problem is that the same component is deployed in many clusters and currently the configuration is fixed - the same value for that specific component in all clusters. To get the recommendations, I execute the krr tool on the same namespace in all clusters. That process is quite long because the tool prepares recommendations for 36 pods in every cluster. I am interested with the results for only one of those pods in every cluster.

Describe the solution you'd like

The simple strategy provides the --namespace parameter to select which namespace should be checked. It would be nice to have an additional parameter called --name. Then I can specify:

krr simply --namespace namespace --name component1

and only 1 component (name of the deployment/stateful) would be checked with 1-X pods.

Describe alternatives you've considered

I saw there was a new parameter added which has been not released yet: --selector. If the K8s objects are labeled properly, it could be used to find such items too.

agabrys avatar Jul 14 '23 11:07 agabrys

Hey, @agabrys

The --name is a good option, but --selector was implemented for your exact usecase. But I agree, that --name can be useful also.

LeaveMyYard avatar Jul 18 '23 10:07 LeaveMyYard

Hello @LeaveMyYard. The v1.4.0 has been released today. It contains the --selector parameter. Should I close this issue? I feel the feature idea is still valid, but from other side if you do not plan to work on it, then there is no sense to keep the issue in the open status forever (cleaner backlog = happier developers 🙂)

agabrys avatar Jul 18 '23 16:07 agabrys

@agabrys Thanks, I still wish to implement your idea :) So I will close myself when implemented

LeaveMyYard avatar Jul 27 '23 09:07 LeaveMyYard