enhancements icon indicating copy to clipboard operation
enhancements copied to clipboard

KEP-4785: CRDMetrics Controller

Open rexagod opened this issue 1 year ago • 1 comments

  • One-line PR description: This KEP proposes the incorporation of the CRDMetrics controller into the Kubernetes organization, similar to its existing counterpart for native metrics, Kube State Metrics.
  • Issue link: https://github.com/kubernetes/enhancements/issues/4785
  • Other comments: Please refer to https://github.com/rexagod/crdmetrics for more details.

rexagod avatar Aug 27 '24 21:08 rexagod

Is CustomResourceMetricsConfig a better name?

SGTM

sftim avatar Nov 08 '24 10:11 sftim

  • [ ] TODO: https://github.com/kubernetes/enhancements/pull/4811#discussion_r1834046385

rexagod avatar Nov 11 '24 22:11 rexagod

@mrueg Regarding naming the managed resource CustomResourceMetricsConfig, I agree with the change, however, since a rename will entail renaming the repository and a good amount of refactor (mostly variable names and test data), I want to clarify some concerns before I start with that, these being:

  • Can we truncate the prefix CustomResource to CR in accordance with the existing CRDMetricsResources? This will ensure a uniform crmetrics (case-insensitive) rather than crmetrics and customresourcemetrics (for instance, in the package name and variable names).
  • Can we drop the suffix Config, as future additions may add fields other than Configuration to the spec, which may or may not influence the metrics generation directly?

To sum it up, would CRMetricsResource make sense? I'm fine with dropping the Resource suffix if there's a better alternative that accommodates for possible changes to the spec in the future.

rexagod avatar Nov 13 '24 15:11 rexagod

CustomResourceMetrics doesn't work because of the plural verb? A few other suggestions: CustomResourceMonitor (similar to ServiceMonitor / PodMonitor from Prometheus-Operator) CustomResourceState (dropping metrics here, because hypothetically in future you would wan to send events on changes)

How many CRDs do we need? I assumed this one is the only one we need to create the configuration for the controller? Is there another one you've been thinking of for CRDs? Can we combine them?

mrueg avatar Nov 13 '24 22:11 mrueg

ACK, I believe there's only one planned for now. Building on the suggestions above, you think CRMetricsMonitor would be a good idea?

cc @sftim

rexagod avatar Nov 20 '24 16:11 rexagod

ACK, I believe there's only one planned for now. Building on the suggestions above, you think CRMetricsMonitor would be a good idea?

cc @sftim

assuming we might extend this to core resources as well. how about ResourceMetricsMonitor ?

mrueg avatar Nov 20 '24 16:11 mrueg

Ah, nice catch! That makes perfect sense.

For the repository name though, I'm thinking something along the lines of resource-metrics-operator?

rexagod avatar Nov 20 '24 17:11 rexagod

Ah, nice catch! That makes perfect sense.

For the repository name though, I'm thinking something along the lines of resource-metrics-operator?

Sounds good or maybe resource-state-metrics (to match kube-state-metrics)?

mrueg avatar Nov 20 '24 17:11 mrueg

+100! I'll make the changes. Thanks a bunch for all the sound suggestions here! 🚀

rexagod avatar Nov 20 '24 17:11 rexagod

The repository name? I'd use -controller; it's a controller not an operator.

sftim avatar Nov 20 '24 18:11 sftim

Hmm, I believe that can be left out in case of controllers? For instance, this or this?

Correct me if I'm wrong here, but the only controller-suffixed repository I found under the organization was sample-controller, which I believe makes sense to accommodate for the lack of brevity (sample)?

rexagod avatar Nov 20 '24 19:11 rexagod

I've tried to move things accordingly after archiving https://github.com/rexagod/crdmetrics/ in favor of https://github.com/rexagod/resource-state-metrics, but PLMK if I missed something. I believe with the the latest patch, all reviews till now are addressed.

rexagod avatar Nov 21 '24 00:11 rexagod

/approve

This looks good for the first alpha release. Thanks for your work on this @rexagod :rocket:

mrueg avatar Dec 16 '24 11:12 mrueg

/cc @richabanker

rexagod avatar Dec 18 '24 07:12 rexagod

/lgtm looking good for alpha, thanks for pushing this through!

richabanker avatar Dec 18 '24 20:12 richabanker

/cc @wojtek-t

rexagod avatar Dec 19 '24 02:12 rexagod

Thank you for the thorough review, @wojtek-t, the out-of-tree nature of this KEP had me a bit confused. I believe this is good for another round of reviews now 🙇🏼

rexagod avatar Jan 21 '25 07:01 rexagod

cc @wojtek-t for another review here please.

rexagod avatar Feb 05 '25 19:02 rexagod

Friendly ping, @wojtek-t for another look here please.

rexagod avatar Mar 04 '25 17:03 rexagod

Bump.

cc @kubernetes/production-readiness if folks have spare cycles to help get this reviewed and merged.

rexagod avatar Mar 10 '25 17:03 rexagod

Friendly ping, @wojtek-t for another look here please.

Sorry for huge delay - this looks good enough for me, especially for the external component.

/approve PRR

wojtek-t avatar Apr 25 '25 13:04 wojtek-t

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrueg, rexagod, wojtek-t

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Apr 25 '25 13:04 k8s-ci-robot

/lgtm

dgrisonnet avatar Jun 17 '25 13:06 dgrisonnet