Skip to content
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

KEP-4785: Resource State Metrics #4811

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

rexagod
Copy link
Member

@rexagod rexagod commented Aug 27, 2024

  • 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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. labels Aug 27, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 27, 2024
@rexagod rexagod mentioned this pull request Aug 27, 2024
4 tasks
@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2024
@logicalhan logicalhan self-assigned this Aug 29, 2024
@logicalhan logicalhan added the lead-opted-in Denotes that an issue has been opted in to a release label Aug 29, 2024
Resource State API from Kube State Metrics, and replace it by the CRDMetrics
controller which, in addition to its own benefits, would allow Kube State
Metrics to drop all Custom Resource State API-specific behaviors that can crash
Kube State Metrics, directly affecting the availability of native metrics
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This KEP proposes the incorporation of the CRDMetrics controller into
the Kubernetes organization, similar to its existing counterpart for
native metrics, Kube State Metrics.
Refer: https://github.com/rexagod/crdmetrics
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to see this :-)

I will follow along and try to engage and help where possible for me!

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

I'm afraid I do have questions.

@rexagod rexagod mentioned this pull request Oct 21, 2024
4 tasks
@rexagod rexagod requested review from sftim, dgrisonnet and mrueg November 8, 2024 09:15
Copy link
Member

@mrueg mrueg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this @rexagod ! I added a few comments.

@sftim
Copy link
Contributor

sftim commented Nov 8, 2024

Is CustomResourceMetricsConfig a better name?

SGTM

@mrueg
Copy link
Member

mrueg commented Dec 16, 2024

/approve

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

@rexagod
Copy link
Member Author

rexagod commented Dec 18, 2024

/cc @richabanker

@richabanker
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 18, 2024
@rexagod
Copy link
Member Author

rexagod commented Dec 19, 2024

/cc @wojtek-t

# of http://git.k8s.io/enhancements/OWNERS_ALIASES
kep-number: 4785
alpha:
approver: "@johnbelamaric"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to reassign to me, given I was cc-ed anyway.

existing tests to make this code solid enough prior to committing the changes necessary
to implement this enhancement.

##### Prerequisite testing updates
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test plan has to be filled in even for Alpha.

cluster required to make on upgrade, in order to make use of the enhancement?
-->

N/A.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrade/Downgrade is never N/A. It can be simple (no action required or sth), but it's always there.

But here, I don't think it's that obvious, in particular, how to we handle changes in the API?

This section must be completed when targeting alpha to a release.
-->

N/A.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

of a node?
-->

N/A.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can't be N/A - I need to be able to disable the feature. How can I do it?

  • disable kube-state-metrics?
  • remove the appropriate custom resources?
  • something else?

previous answers based on experience in the field.
-->

N/A.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

logs or events for this purpose.
-->

N/A.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain that this is not a workload feature - it's an additional telemetry.

This section must be completed when targeting beta to a release.
-->

The controller __directly__ imports the following `k8s.io` packages:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a question about runtime dependencies, not the code dependencies.

- Impact of its degraded performance or high-error rates on the feature:
-->

The controller relies on core Kubernetes components.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be more specific - it's effectively serving stack only, right (kube-apiserver + etcd + potentially webhooks etc.)

- Estimated amount of new objects: (e.g., new Object X for every existing Pod)
-->

The controller will **not** create or modify any object on its own. Only when a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit misleading - it actually is modifying managed resources when it's created/updated.

@wojtek-t wojtek-t self-assigned this Jan 8, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 20, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mrueg, rexagod
Once this PR has been reviewed and has the lgtm label, please ask for approval from wojtek-t. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@rexagod
Copy link
Member Author

rexagod commented Jan 21, 2025

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 rexagod requested a review from wojtek-t January 27, 2025 16:53
@rexagod
Copy link
Member Author

rexagod commented Feb 5, 2025

cc @wojtek-t for another review here please.

@dashpole dashpole removed the lead-opted-in Denotes that an issue has been opted in to a release label Feb 13, 2025
@rexagod
Copy link
Member Author

rexagod commented Mar 4, 2025

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

@rexagod
Copy link
Member Author

rexagod commented Mar 10, 2025

Bump.

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

@@ -0,0 +1,1216 @@
<!--
**Note:** When your KEP is complete, all of these comment blocks should be removed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ are we good to remove all comment blocks? That will make it easier to review I guess? @rexagod

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe "complete" here means stable graduation, but I could be wrong.

Comment on lines +409 to +412
At the moment, the `spec` houses a single `configuration` field, which defines
the metric generation configuration as follows (please note that the schema is
fast-moving at this point and may be subject to change based on the [feedback
obtained](https://github.com/rexagod/resource-state-metrics/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be considired to be changed in future and have the configuration be a typed api?

WIth having a .spec.configuration field which is a string, we could also just use a configmap or secret instead 🤔

Also to build tooling on top (e.g. to generate a configuration for a CRD from markers) it would be helpful to have this an typed API.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of taking a config parameter reference - eg

  configurationReference:
    apiVersion: v1       # for alpha, has to be ConfigMap
    kind: ConfigMap      # for alpha, has to be ConfigMap
    namespace: example   # optional, but must be set for initial / alpha implementation
    name: rsm-config
    itemPath: >-
      data.config

help: "Information about a MyPlatform instance" # The help text for the
# metric family, plugged
# in as-is.
metrics: # Set of metrics to generate under the current metrics family.
Copy link
Member

@chrischdi chrischdi Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have an example on how this could look like on arrays inside a resurce?

E.g. metrics for .status.conditions :-)

(let me know if this is too early, as this is technical implementation question)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.