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

feat(CustomResourceState): Support quantities and percentages #1989

Merged
merged 2 commits into from
Mar 1, 2023

Conversation

mrueg
Copy link
Member

@mrueg mrueg commented Feb 10, 2023

What this PR does / why we need it:
In order to be able to deprecate the VPA completely, CRS needs to be aware of quantities. See #1790 (comment)

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
None

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
See also #1790

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 10, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 10, 2023
@mrueg mrueg force-pushed the crs-support-quantity branch 2 times, most recently from 10f8a9c to 093cfb6 Compare February 10, 2023 14:23
@logicalhan
Copy link
Member

/triage accepted
/assign @rexagod

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 23, 2023
@logicalhan
Copy link
Member

/triage accepted
/assign @rexagod

@rexagod
Copy link
Member

rexagod commented Feb 23, 2023

@mrueg Can we incorporate support for percentages as well? IIRC that's the only other quantity format that's causing issues.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 27, 2023
@mrueg
Copy link
Member Author

mrueg commented Feb 27, 2023

@rexagod good idea, I've added support for it as well.

@mrueg mrueg force-pushed the crs-support-quantity branch from ee77e6e to 3c40f03 Compare February 27, 2023 12:05
@mrueg mrueg changed the title feat(CustomResourceState): Support quantities feat(CustomResourceState): Support quantities and percentages Feb 27, 2023
@rexagod
Copy link
Member

rexagod commented Feb 28, 2023

I see this incorporates support for path pointing to such quantities, but it seems valueFrom still needs to inherit this behavior. We can do that in a different PR, or get it addressed in this one itself, whichever sounds better. 👍🏼

            # Works.
            type: Gauge
            gauge:
              path: [foo, bar, baz, que]
            # Needs to be addressed.
            type: Gauge
            gauge:
              path: [foo]
              valueFrom: [bar, baz, que]

@mrueg mrueg force-pushed the crs-support-quantity branch 2 times, most recently from 5449eb0 to 10b4ad8 Compare March 1, 2023 11:00
@mrueg
Copy link
Member Author

mrueg commented Mar 1, 2023

@rexagod I've added a valueFrom testcase, this seems to work for both. Can you clarify if I am missing anything?

@mrueg mrueg force-pushed the crs-support-quantity branch from 10b4ad8 to 8f35094 Compare March 1, 2023 14:24
@rexagod
Copy link
Member

rexagod commented Mar 1, 2023

Ah, yep, that was my bad. The PR is good for valueFrom. I forgot the issue with multiple relative-path in valueFrom still persists. Basically, I was testing this PR on this config,

            # Same as in the example above.
            type: Gauge
            gauge:
              path: [foo]
              valueFrom: [bar, baz, que]

when I should've tested it on,

            # Works.
            type: Gauge
            gauge:
              path: [foo, bar, baz]
              valueFrom: [que] # Only single-paths are supported as of now.

We just need to resolve the failing test and this should be good! 🚀

@mrueg mrueg force-pushed the crs-support-quantity branch from 8f35094 to d799f40 Compare March 1, 2023 18:14
@mrueg
Copy link
Member Author

mrueg commented Mar 1, 2023

@rexagod I rebased on the latest main branch and fixed the test. :)

@rexagod
Copy link
Member

rexagod commented Mar 1, 2023

/lgtm
Thank you for the patch! :)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 1, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 k8s-ci-robot merged commit 054f2a4 into kubernetes:main Mar 1, 2023
@djfinnoy
Copy link

Any chance of getting this included in a release soon? We need it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants