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

Support autoscaling/v2 API alongside autoscaling/v2beta1 #121

Merged

Conversation

voelzmo
Copy link
Member

@voelzmo voelzmo commented Apr 6, 2023

What this PR does / why we need it:
Adds conversions to use autoscaling/v2beta1 in all calls to kube-apiserver when autoscaling/v2 is not available. Internally, the HVPA continues to operate on autoscaling/v2beta1 objects.

This is essentially what g/g does as well: we're using autoscaling/v2 for all k8s versions >=1.23, which introduced autoscaling/v2.

Which issue(s) this PR fixes:
fixes #104

Special notes for your reviewer:

Release note:

HVPA supports k8s versions >= 1.25 by switching to `k8s.io/autoscaling/v2` when necessary for all API calls.

@voelzmo voelzmo requested a review from a team as a code owner April 6, 2023 12:26
@gardener-robot gardener-robot added needs/review Needs review size/l Size of pull request is large (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Apr 6, 2023
@voelzmo
Copy link
Member Author

voelzmo commented Apr 6, 2023

/invite @andrerun

@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Apr 6, 2023
@gardener-robot gardener-robot added size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) and removed size/l Size of pull request is large (see gardener-robot robot/bots/size.py) labels Apr 6, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Apr 6, 2023
@voelzmo voelzmo force-pushed the enh/hpa-autoscaling-v2-by-internal-conversion branch from 8bc2159 to 59f7623 Compare April 6, 2023 13:00
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 6, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 6, 2023
Copy link
Contributor

@andrerun andrerun left a comment

Choose a reason for hiding this comment

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

Looks good. Check the question about the v2 code syncing multiple fields where the v2beta1 code is only syncing MinReplicas. Also whether you actually want to update cache before validating the incoming object instance.

The rest are all cosmetic nits - just check if you want to make changes based on any of them.

.ci/integration_test Outdated Show resolved Hide resolved
controllers/hpa_util.go Show resolved Hide resolved
controllers/hpa_util_test.go Show resolved Hide resolved
controllers/hpa_util.go Show resolved Hide resolved
controllers/hvpa_controller.go Show resolved Hide resolved
controllers/hvpa_controller.go Outdated Show resolved Hide resolved
controllers/hvpa_controller.go Outdated Show resolved Hide resolved
controllers/hvpa_controller.go Show resolved Hide resolved
controllers/suite_test.go Show resolved Hide resolved
main.go Show resolved Hide resolved
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Apr 13, 2023
@voelzmo voelzmo force-pushed the enh/hpa-autoscaling-v2-by-internal-conversion branch from 84ce76e to 9d5da89 Compare April 13, 2023 09:33
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Apr 13, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 13, 2023
@voelzmo voelzmo force-pushed the enh/hpa-autoscaling-v2-by-internal-conversion branch from 75f7725 to b105ef2 Compare April 13, 2023 10:23
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 13, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 13, 2023
@voelzmo voelzmo force-pushed the enh/hpa-autoscaling-v2-by-internal-conversion branch from b105ef2 to ff81f2f Compare April 13, 2023 11:38
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 13, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 13, 2023
@voelzmo voelzmo merged commit 16f4823 into gardener:master Apr 19, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review needs/second-opinion Needs second review by someone else size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Handle autoscaling/v2 API version for HorizontalPodAutoscaler
6 participants