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

Deprecate VPA #1835

Merged
merged 1 commit into from
Nov 14, 2022
Merged

Deprecate VPA #1835

merged 1 commit into from
Nov 14, 2022

Conversation

rexagod
Copy link
Member

@rexagod rexagod commented Sep 15, 2022

  • Deprecate VPA metrics.
  • Inform users about the deprecation (print a warning to stdout).
  • Document an alternative approach using the CRD capabilities we have now.

Signed-off-by: Pranshu Srivastava rexagod@gmail.com

How does this change affect the cardinality of KSM: No change (VPA metrics will be removed in v2.9.0).

Which issue(s) this PR fixes: Partially targets #1718.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 15, 2022
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 15, 2022
@rexagod rexagod marked this pull request as draft September 15, 2022 06:37
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 15, 2022
@rexagod rexagod marked this pull request as ready for review September 18, 2022 18:08
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 18, 2022
Copy link
Contributor

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

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

Thanks.

/lgtm
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 23, 2022
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 23, 2022
internal/store/builder.go Outdated Show resolved Hide resolved
Comment on lines 7 to 20
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: autoscaling.k8s.io
kind: "VerticalPodAutoscaler"
version: "v1"
metrics:
- name: "generation"
help: "VPA Generation"
each:
type: Gauge
gauge:
path: [metadata, generation]
Copy link
Member

Choose a reason for hiding this comment

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

Could we provide them with a manifest that generates exactly the same metrics as we had before? I know that we won't be able to get the exact same names so it would get great to also point the name changes.

| kube_verticalpodautoscaler_spec_updatepolicy_updatemode | Gauge | `namespace`=&lt;namespace&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `update_mode`=&lt;foo&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
## DEPRECATION NOTICE

From v2.8.0 onwards, `vericalpodautoscalers` will be removed from the list of default resources. This means that specifying that in the `--resource` flag will **not** generate metrics for the same. In order to generate `verticalpodautoscalers` metrics, you will have to explicitly specify it in `--custom-resource-state-config*` (either the inline yaml, or the configuration file), like so:
Copy link
Member

Choose a reason for hiding this comment

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

Since v2.6.0 has already been released, we should only start removing VPA in v2.9.0 since the deprecation period should be of at least 2 releases.

Copy link
Member

@mrueg mrueg Oct 5, 2022

Choose a reason for hiding this comment

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

IMHO, we should bump version to v3 if we remove VPA metrics.

Copy link
Member

Choose a reason for hiding this comment

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

Breaking changes used to be reserved for major releases when following semantic versioning, but what we've seen in recent years is that projects with only minor releases are healthy and can still handle breaking changes properly as long as they have clear deprecation policies, which is the case for Kubernetes for example. IMHO major releases should only be reserved for major rewrites, which don't include VPA metrics removal. If we are not confident that the deprecation period is enough, I am fine with increasing it, but I don't think waiting for a major release is the right call here.

What do you think @fpetkovski?

Copy link
Member

Choose a reason for hiding this comment

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

I can understand that major releases can become quite painful with go versioning. Personally, I prefer going with the least surprise for users. Users won't be happy when their VPA metrics are gone and they did not see it coming.

Copy link
Member

@dgrisonnet dgrisonnet Nov 9, 2022

Choose a reason for hiding this comment

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

The problem is that there is no reason to cut a new major today besides removing the VPA metrics, which is not a big enough reason to justify a new major version in my opinion. Leaving a long enough deprecation period should already be good enough to not surprise the users. At the very least if we are not confident enough that our users are going through our changelogs, we can add a log line when the vpa store is used saying that it is deprecated and will be removed in version x.y.z.

Copy link
Member

Choose a reason for hiding this comment

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

Experimental features should not have stability guarantees.

Copy link
Member

Choose a reason for hiding this comment

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

Apologies here, I wasn't aware that VPA never made it stable. I'm fine with deprecating and removing without bumping major here. Thanks for explaining!

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 26, 2022
@dgrisonnet
Copy link
Member

The unit tests are failing, you need to the update the test metadata to include the deprecation notice: https://github.com/kubernetes/kube-state-metrics/blob/master/internal/store/verticalpodautoscaler_test.go#L33-L40

@rexagod
Copy link
Member Author

rexagod commented Nov 6, 2022

Moved to v3, ready for review.

@rexagod
Copy link
Member Author

rexagod commented Nov 8, 2022

cc @dgrisonnet @mrueg @logicalhan

@dgrisonnet
Copy link
Member

I am still very much against cutting a new major version of ksm just for deprecating VPA metrics. This is not an overhaul of the codebase, we are just deprecating some metrics and replacing them with new ones. See it as a renaming of metrics rather than a complete removal.

Also, it is worth noting that all the VPA metrics are experimental so although they have been in the codebase for a while, users shouldn't expect them to never change.

Holding until we've reached a consensus.
/hold

@logicalhan
Copy link
Member

I am still very much against cutting a new major version of ksm just for deprecating VPA metrics. This is not an overhaul of the codebase, we are just deprecating some metrics and replacing them with new ones. See it as a renaming of metrics rather than a complete removal.

Also, it is worth noting that all the VPA metrics are experimental so although they have been in the codebase for a while, users shouldn't expect them to never change.

Holding until we've reached a consensus. /hold

Yeah, cutting a release for deleting experimental metrics seems a bit much to me too.

@rexagod
Copy link
Member Author

rexagod commented Nov 9, 2022

Reverted to v2.9.0 (#1835 (comment)).

Deprecate VPA metrics in v2.9.0.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
@mrueg
Copy link
Member

mrueg commented Nov 10, 2022

/approve

@rexagod
Copy link
Member Author

rexagod commented Nov 11, 2022

@mrueg Can you please /lgtm (if all looks good here)?

@mrueg
Copy link
Member

mrueg commented Nov 14, 2022

/lgtm
/hold cancel
Proceeding here, thanks for your contribution @rexagod!

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 14, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fpetkovski, 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 9edd02b into kubernetes:master Nov 14, 2022
@hajdukda
Copy link

hajdukda commented Aug 9, 2023

So what are the alternatives now to get those metrics ? Sry starting with vpa just to have free recommendations instead of paying 15k to some random saas.

@dgrisonnet
Copy link
Member

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants