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

HPA: bump apiVersion to v2 for defaultBackend #9731

Merged

Conversation

dohoangkhiem
Copy link
Contributor

@dohoangkhiem dohoangkhiem commented Mar 14, 2023

What this PR does / why we need it:

autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2 HorizontalPodAutoscaler
We had a hardcode apiVersion: autoscaling/v2beta1 in default-backend-hpa.yaml

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 #9728

How Has This Been Tested?

$ helm template --set defaultBackend.enabled=true  --set defaultBackend.autoscaling.enabled=true . | grep -A2 -B2 HorizontalPodAutoscaler
# Source: ingress-nginx/templates/default-backend-hpa.yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  labels:
  
$ helm template --set defaultBackend.enabled=true  --set defaultBackend.autoscaling.enabled=true --set defaultBackend.autoscaling.apiVersion=autoscaling/v2beta2 . | grep -A2 -B2 HorizontalPodAutoscaler
# Source: ingress-nginx/templates/default-backend-hpa.yaml
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  labels:

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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 14, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: dohoangkhiem / name: Do Hoang Khiem (74a8f4a0201829955438dfff6dec95543b8bbdbb)

@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 Mar 14, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @dohoangkhiem!

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-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Mar 14, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @dohoangkhiem. 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. labels Mar 14, 2023
@k8s-ci-robot k8s-ci-robot added the area/helm Issues or PRs related to helm charts label Mar 14, 2023
@k8s-ci-robot k8s-ci-robot requested a review from cpanato March 14, 2023 07:13
@k8s-ci-robot k8s-ci-robot added 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 Mar 14, 2023
@longwuyuan
Copy link
Contributor

@dohoangkhiem I think https://github.com/kubernetes/ingress-nginx/pull/9348/files should have taken care of the default-backend template as well but did not so thanks for this fix.

But @tao12345666333 needs to review this and if clean, then this should get merged sooner than later because K8S latest release is v1.26 already so as per policy to support current + 2 previous releases, its time to move to autoscaling/v2

/triage accepted
/kind bug
/area stabilization
/priority important-now

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/bug Categorizes issue or PR as related to a bug. area/stabilization Work for increasing stabilization of the ingress-nginx codebase and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 14, 2023
@k8s-ci-robot
Copy link
Contributor

@longwuyuan: The label(s) priority/important-now cannot be applied, because the repository doesn't have them.

In response to this:

@dohoangkhiem I think https://github.com/kubernetes/ingress-nginx/pull/9348/files should have taken care of the default-backend template as well but did not so thanks for this fix.

But @tao12345666333 needs to review this and if clean, then this should get merged sooner than later because K8S latest release is v1.26 already so as per policy to support current + 2 previous releases, its time to move to autoscaling/v2

/triage accepted
/kind bug
/area stabilization
/priority important-now

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 removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Mar 14, 2023
@longwuyuan
Copy link
Contributor

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority labels Mar 14, 2023
@longwuyuan
Copy link
Contributor

@dohoangkhiem did you create an issue also for the problem you faced. It will help if you create a issue for the problem you faced and add details there. Then link that issue here

@longwuyuan
Copy link
Contributor

cc @tao12345666333 seeking review on this as deprecated HPA api version is hardcoded in default-backend template and seems to be breaking installs on K8S v1.25.X

@tao12345666333
Copy link
Member

ci job failed

@longwuyuan
Copy link
Contributor

checking

@longwuyuan
Copy link
Contributor

@dohoangkhiem how did you create the helm chart README ? You can not edit the helm chart README manually. You have to edit the values file and use helm-docs to generate the helm chart README in your fork+clone lcoally. Then you have to check in the locally modified values file and README.

@dohoangkhiem dohoangkhiem force-pushed the hpa-apiversion-default-backend branch from 74a8f4a to 361be7e Compare March 14, 2023 07:54
@longwuyuan
Copy link
Contributor

/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 Mar 14, 2023
@dohoangkhiem
Copy link
Contributor Author

dohoangkhiem commented Mar 14, 2023

@dohoangkhiem how did you create the helm chart README ? You can not edit the helm chart README manually. You have to edit the values file and use helm-docs to generate the helm chart README in your fork+clone lcoally. Then you have to check in the locally modified values file and README.

Thanks @longwuyuan for guiding, yes I updated the README and linked a related issue.

@longwuyuan
Copy link
Contributor

@dohoangkhiem this is a important fix because of the hardcoding so thanks for the PR.

Whenever you get a chance, please help by adding details like I mentioned. As you can see in the linked issue, one user experienced failed install of controller with default-backend HPA api version error (using terraform helm). Similarly it will help to get details of how you came to know this problem and what were the precise scene and use case to discover this problem. Then link that issue here

@longwuyuan
Copy link
Contributor

@tao12345666333 CI passed

Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dohoangkhiem, tao12345666333

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 Mar 14, 2023
@k8s-ci-robot k8s-ci-robot merged commit e2d076c into kubernetes:main Mar 14, 2023
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 area/stabilization Work for increasing stabilization of the ingress-nginx codebase cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. size/XS Denotes a PR that changes 0-9 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.

HorizontalPodAutoscaler api version prevents upgrade to K8s version 1.25+
4 participants