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

fix(hpa): deprecated api version, bump to v2 #9348

Merged
merged 8 commits into from
Dec 4, 2022

Conversation

sjoukedv
Copy link
Contributor

What this PR does / why we need it:

autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2 HorizontalPodAutoscaler

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

fixes #9347

How Has This Been Tested?

n.a.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.
  • Added Release Notes.
Horizontal Pod Autoscaler - deprecated api version, bump to v2

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 29, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: sjoukedv / name: Sjouke de Vries (c8b3c2c)

@k8s-ci-robot k8s-ci-robot added the area/helm Issues or PRs related to helm charts label Nov 29, 2022
@k8s-ci-robot k8s-ci-robot requested a review from cpanato November 29, 2022 05:38
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 29, 2022
@k8s-ci-robot
Copy link
Contributor

@sjoukedv: This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

Welcome @sjoukedv!

It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/ingress-nginx has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 29, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @sjoukedv. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 29, 2022
@longwuyuan
Copy link
Contributor

@sjoukedv Thanks for your contribution

  • Please check Determine the hpa version and select the hpa version #8872. I think they are either conflcting on how to solve the problem or they are duplicates.
  • We need data here that explaains backwards compatibility in the special way this project handles users. We officially do not support more than current -2 versions of K8s but we also try hard not to break backwards compatibility, to be best possible chances. That means I still did not look at the code change but want to flesh the content here with the design aspects as well as the context of that other PR i linked above

@longwuyuan
Copy link
Contributor

I just discovered a odd thing that the other PR I linked has 0 files changed #8872 (comment)

Maybe we need to wait and find out more. The focus is the conditional use of hpa api version based on K8s version etc.

@sjoukedv
Copy link
Contributor Author

sjoukedv commented Nov 29, 2022

@sjoukedv Thanks for your contribution

  • Please check Determine the hpa version and select the hpa version #8872. I think they are either conflcting on how to solve the problem or they are duplicates.
  • We need data here that explaains backwards compatibility in the special way this project handles users. We officially do not support more than current -2 versions of K8s but we also try hard not to break backwards compatibility, to be best possible chances. That means I still did not look at the code change but want to flesh the content here with the design aspects as well as the context of that other PR i linked above

I can refactor with a helm value that allows you to still use the older (deprecated) version.

The other PR has the same purpose, but contains no changed files.

@sjoukedv
Copy link
Contributor Author

sjoukedv commented Nov 29, 2022

Okay, I have abstracted the value of the apiVersion, so that people can override it with a different one. @longwuyuan I'll leave it to you which one you would like to set as default (now it still ``autoscaling/v2beta2`).

Dry run without the version yields the template as is now:

$ helm install test ./charts/ingress-nginx/ --values=./charts/ingress-nginx/values.yaml --set controller.autoscaling.enabled=true --dry-run | grep 'HorizontalPodAutoscaler' -B 1
W1129 11:18:39.432722  123922 warnings.go:70] autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2 HorizontalPodAutoscaler
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler

Specifying the apiVersion:

$ helm install test ./charts/ingress-nginx/ --values=./charts/ingress-nginx/values.yaml --set controller.autoscaling.enabled=true --set controller.autoscaling.apiVersion=autoscaling/v2 --dry-run | grep 'HorizontalPodAutoscaler' -B 1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler

@longwuyuan
Copy link
Contributor

cc @rikatz @tao12345666333

@rikatz
Copy link
Contributor

rikatz commented Nov 29, 2022

Sgtm, when was v2beta2 deprecated and when v2 got stable? I would default to the stable one if it is available for at least 3 releases

@sjoukedv
Copy link
Contributor Author

sjoukedv commented Nov 29, 2022

Sgtm, when was v2beta2 deprecated and when v2 got stable? I would default to the stable one if it is available for at least 3 releases

https://kubernetes.io/docs/reference/using-api/deprecation-guide/#horizontalpodautoscaler-v125

the autoscaling/v2 API version, available since v1.23

So that makes 3 releases. Important to note for the upcoming version 1.26

The autoscaling/v2beta2 API version of HorizontalPodAutoscaler will no longer be served in v1.26.

@rikatz
Copy link
Contributor

rikatz commented Nov 29, 2022

1.23, 1.24, 1.25 = 3 releases :)
let’s move forward. Can you just check the ci errors?
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 29, 2022
@k8s-ci-robot k8s-ci-robot removed the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 29, 2022
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 29, 2022
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 29, 2022
@sjoukedv
Copy link
Contributor Author

1.23, 1.24, 1.25 = 3 releases :) let’s move forward. Can you just check the ci errors? /ok-to-test

I have changed the default apiVersion to autoscaling/v2 and added documentation about the parameter in the README (this failed the CI before)

@sjoukedv
Copy link
Contributor Author

Can someone check the pipeline? I didn't make any changes to the source files yet that is where it fails.

@longwuyuan
Copy link
Contributor

Did you edit the README.md undr /charts manually to add that one line for autoscaling ?

@sjoukedv
Copy link
Contributor Author

nually to add that one line for autoscaling ?

Yes, I did and afterwards I ran the helm-docs go module on it. Perhaps a re-trigger would do the trick already.

@sjoukedv
Copy link
Contributor Author

@longwuyuan All jobs have passed now

@longwuyuan
Copy link
Contributor

@sjoukedv thanks
/lgtm

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

rikatz commented Dec 4, 2022

/lgtm
/approve
Thank you

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: longwuyuan, rikatz, sjoukedv

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 4, 2022
@k8s-ci-robot k8s-ci-robot merged commit 27ffeeb into kubernetes:main Dec 4, 2022
@wasker
Copy link
Contributor

wasker commented Dec 12, 2022

When the chart with this change is going to be published? Long-awaited fix...

jaehnri pushed a commit to jaehnri/ingress-nginx that referenced this pull request Jan 2, 2023
* fix(hpa): deprecated api version, bump to v2

* chore(hpa): abstract hpa apiVersion to helm value

* feat(hpa): add controller.autoscaling.apiVersion docs in README

* docs(hpa): quotes around apiVersion string type

* chore(hpa): run helm-docs in repo

* chore(hpa): remove local helm-docs module install and output

* docs(helm): add hpa controller.autoscaling.apiVersion description

* docs(hpa): remove autoscaling.apiVersion description as it fails ci
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. area/helm Issues or PRs related to helm charts 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. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HorizontalPodAutoscaler API version is deprecated
5 participants